WP-PageNavi not working on category.php
WP-PageNavi not working on category.php
WP-PageNavi not working on category.php
It always displays the first page because you tell it to: ‘paged’ => ‘1’ 🙂 That said changing main query and especially pagination inside a template is inherently unreliable. For proper customization of such you should always be adjusting main query before template is ever reached via appropriate hooks, typically pre_get_posts.
AFAIK, there is no way limiting the amount of paged queries with what is given by default. You might be able to make use of the filters provided to alter the SQL query. You also do not want to use query_posts at all and most probably you don’t even need a custom query. If this … Read more
I guess you don’t need to target a taxonomy. You can use the code below: function query_change_function( $query ) { $query->set( ‘posts_per_page’, 5 ); } add_action(‘pre_get_posts’, ‘query_change_function’); You should wrap the $query->set( ‘posts_per_page’, 5 ); around with if ( ! is_admin() && is_home() ) {//the $query->set code} to avoid it changing to 5-posts everywhere.
Your construction of your custom loop is a bit of a mess unfortuantely. I’m not going to go through this now, but I’ll add links for you to go and read through :-). You should go and have a look on how to properly construct a custom query with WP_Query. You should also have a … Read more
You don’t have a code issue, just CSS. In your default.css, just at the end, add this: #menu-under-header .navbar-inner ul{clear:both !important; width:1000px;} .menu-header-container{clear:both !important;} #social-networking{clear:both !important;} and that’s it. You may want to add a position for social networking. IN that case, replace the last line with this: #social-networking{clear:both !important; position:relative; left:760px;} EDIT: SEE THE … Read more
I replaced it with: $out .= $instance->get_single( 1, ‘first’, “All”, 100, 1 ); And I changed the get_single function, more exactly I added a parameter, “all”, and this one won’t afect anything else. function get_single( $page, $class, $raw_text, $format=”%PAGE_NUMBER%”, $all = 0 ) { if ( empty( $raw_text ) ) return ”; $text = str_replace( … Read more
I didn’t load the plugin to check and I never use query_posts(), but perhaps tie_pagenavi() is depending on the value in the $paged global variable. Try adjusting that value before (or after) calling query_posts(). Here is the code to adjust it before calling query_posts(). if ( get_query_var( ‘paged’ ) ) // On a paged page. … Read more
Meta query must be done with a nested array. So it may look more like this: $query = new WP_Query( array( ‘meta_query’ => array( array( ‘key’ => ‘duedate’, ‘value’=> $today, ‘compare’ => ‘>=’, ), ), ‘paged’ => $paged, ‘posts_per_page’=>’20’ ) );
You can just use wp_get_nav_menu_items( $menu, $args ); to get list of menu items created in appearance. You can print result the way you want. Before printing just make sure the datas are not empty and so. I didn’t add any validation. So use according to your need. For example: We’ll try to print the … Read more