Pagination for custom post type not working [duplicate]
I believe if posts_per_page is set to -1 you’re showing all posts without pagination. Try setting it to 5 for example.
I believe if posts_per_page is set to -1 you’re showing all posts without pagination. Try setting it to 5 for example.
You could count the number of items and insert </ul><ul> after 50%. Sample code, not tested: if ($postslist) { $count = 1; if($top) echo ‘<h4>’.$name.'</h4>’; echo ‘<ul>’; foreach ( $postslist as $post ) { echo ‘<li><a href=”‘.get_permalink($post->ID).'”>’.get_the_title($post->ID).”</a></li>”; if ( 0 === $count % 10 ) echo ‘</ul><ul>’; $count += 1; } echo ‘</ul>’; } And … Read more
I am not claiming this is a canonical list but the user related capabilities I see are: add_users create_users delete_users edit_users list_users promote_users remove_users I got this working with only list_users and edit_users. I did test all combinations of those, just a few obvious ones. Of course, you may want more capabilities than that.
You could just run DELETE FROM wp_terms WHERE slug LIKE “museum-%” on you MySQL server, but that would probably leave some orphan rows in wp_term_taxonomy and potentially in wp_term_relationships if you have used the terms. While being a bit more complicated I would recommend deleting them using the WordPress API. Something like this might work … Read more
You may want to change your code to something like this: <a href=”https://wordpress.stackexchange.com/questions/83700/<?php the_permalink() ?>” class=”alignnone” title=”<?php the_title(); ?>”> <a href=”<?php the_permalink(); ?>” title=”<?php the_title();?>”> <?php if (has_post_thumbnail()) : ?> <?php the_post_thumbnail(); ?></a> <?php else : ?> <img src=”<?php bloginfo(‘template_url’); ?>/images/noimage.jpg” width=”213″ height=”187″ alt=””/> <?php endif; ?> </a> and I assume you’ve specified a Featured … Read more
Create an endpoint. In the callback function for the endpoint call your plugin functions internally, so the whole WordPress environment is available and you are still on the same domain, no matter where the plugin URL is. Plus, make sure not to flush the rewrite rules on every page load, use the (de)activation hook for … Read more
try adding page like this on post type ‘post_type’ => array( ‘portfolio’, ‘page’ ) post_type can accept array… more of it here… http://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters
You will have to set #menuwrap ul li.current-menu-item a to the color and style you want. The Problem is actually a CSS issue – because the CSS is more specific if an ID of an element is defined (like in your #menuwrap ul li a), so the above definition is even more specific and is … Read more
Change it from: ‘category_name’ => celebrity, ‘orderby’ => 1, into ‘category_name’ => ‘celebrity’, ‘orderby’ => ‘date’, // or something else Otherwise celebrity will be treated as a constant name, not a string. Also, you can’t order by 1, you have to use one of the ordering parameters.
It sounds like your theme is using the_excerpt() instead of the_content() when displaying the post. If you want to display the full post you’ll need to edit your index.php file to use the_content() instead.