Tag Info

Hot answers tagged

2

You can try the following (untested): Setup the query arguments #1: (today) //----------------- // Query part #1: //----------------- $args1 = array( 'post_type' => 'post', 'orderby' => 'comment_count', 'ignore_sticky_posts' => 1, 'date_query' => array( array( ...


1

You will need to duplicate every instance of $wp_query and change it to $the_query. Example global $wp_query, $the_query; /** Stop execution if there's only 1 page */ if( $wp_query->max_num_pages <= 1 || $the_query->max_num_pages <= 1 ) return; EDIT Here is the pagination function that I use. Have no time to code now or to really ...


1

EDIT Referring back to one of your previous questions I've answered, you are using custom taxonomies, so this is most likely your problem then. You then have to set the taxonomy parameter accordingly. See my original answer ORIGINAL ANSWER There are a few things to check here Where is your next_post_link. Did you leave out by default? Are you using ...


1

You should use WP_Query here, also, for pagination, you need to use the paged parameter, because Wordpress need it to calculate the offset. I guess you could replace both queries with WP_Query, and to avoid showing the first post twice, save the ID in a variable and pass it to the post__not_in parameter in the second query. $paged = ...


1

Before we begin, I must point out the following: You're using a file in your theme to send AJAX requests to, don't do this, there are security implications. Instead, use the WP AJAX API, you'll be able to remove half the code and make it work without having to change the URL everytime your site moves You used query_posts to make your query, this is almost ...


1

There where one or two problems with the code that I sorted out Big changes $number_of_terms = count( get_terms( '100list' ) ); is replaced by $number_of_terms = wp_count_terms( '100list' );. The reason is that wp_count_terms is already there to return the term count natively get_categories is replaced by get_terms as get_terms accepts the offset ...


1

I've realised what the issue was... some of my posts were generated (for development purposes) using bulk creator which appears to not create a complete post! When I create a post manually using the WP backend my code works fine, thanks for the suggestions anyway guys!


1

When you are on a taxonomy page, you can get the parent from the term being displayed by using the following code with get_queried_object. See get_terms for the objects that are returned $queried_object = get_queried_object('term'); $term = $queried_object->parent; To get the taxonomy, you can simply just add $tax = $queried_object->taxonomy; ...


1

You can filter the content earlier than these plugins and add the navigation there. Remove wp_link_pages() from the template, and add the following code to the theme: add_filter( 'the_content', function( $content ) { return $content . wp_link_pages( [ 'echo' => FALSE ] ); }, -1 ); // Lower number = higher priority.



Only top voted, non community-wiki answers of a minimum length are eligible