Tag Info

Hot answers tagged

3

you need to study about date query. Anyways following should work <?php $args = array( 'posts_per_page' => -1, 'date_query' => array( array( 'after' => '7 days ago' ) ) ); $query = new WP_Query($args); while ( $query->have_posts() ) { $query->the_post(); // Page title the_title(); } ...


2

The alternative way to handle this problem is to use paginate_links() with get_comments() (or any similar query). Specifically to get the equivalent of max_num_pages, you can use the built-in function wp_count_comments(). So, to get your maximum number of pages, you'd first produce a count of all the comments you want. Presuming you don't want unapproved ...


1

$post_count is a WP_Query variable. You need $the_query->post_count if( $the_query->have_posts() ): ?> <h1>Partners<h1><hr> <?php while( $the_query->have_posts() ) : $the_query->the_post(); if($the_query->post_count=1){ // ... Otherwise it looks like it should work though I am not in a position to ...


1

i have edited your code a bit. And i think it should work.You need to pass parameters to previous_posts_link and next_posts_link. So try the following code <section id="blogposts" class="content-block content-3-5 blogposts"> <div class="row"> <!-- Feature Box 1 --> <?php ...


1

$ids = get_users( array('role' => 'author' ,'fields' => 'ID') ); $contr_limit = count($ids); for($cntr=0; $cntr < $contr_limit; $cntr++){ if( pmpro_hasMembershipLevel($level_id, $ids[$cntr] ) !== true ){ unset($ids[$cntr]); } } $args = array( 'author' => implode(',', $ids), 'orderby' => 'date', ...



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