Remove 5 latest posts from the loop

I don’t know if WP has a built in feature for it’s query but you could do something like this: $count = 0; if(have_posts()) : while (have_posts()) : the_post(); if ($count < 4 ) { $count++; } else { … your blogroll code … } endwhile; endif;

Getting Post Permalink Outside of Loop Not Working

According to: http://wpseek.com/get_comment_count/ $single is the post ID. Try: public function get_comment_count($single){ if (isset($this->params[‘comments’]) && $this->params[‘comments’] == ‘yes’){ return ‘<div id=”disquscomments”><a href=”‘.get_permalink($single).’#disqus_thread”>Comments</a></div>’; } else { return null; } }

How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?

The get_template_part(‘content’, get_post_format()); line includes content from one of the other files in your theme based on the post type, the file name will be something like content-page.php (or content.php if the format is not found). If you print out what get_post_format() returns, you will be able to tell which content file to look into. … Read more

Carousel Loop only duplicating

You should reset the query after your active slider. So place this code after your first loop (after endwhile; endif; ): //Reset Query wp_reset_postdata(); Also try setting the paged atribute: $paged = ( get_query_var(‘paged’) ) ? get_query_var(‘paged’) : 1; // WP_Query arguments $args = array ( ‘post_parent’ => $destination->ID, ‘post_type’ => ‘page’, ‘posts_per_page’ => ‘4’, … Read more

How to do a loop inside a loop?

What if you save each query in a variable ? <ul> <?php $query1 = query_posts( array( ‘posts_per_page’ => -1, ‘post_type’ => array(‘specialties’) )); if($query1->have_posts()): while($query1->have_posts()): $query1->the_post(); ?> <li> <!– title from post type specialties –> <p><?php the_title(); ?></p> <ul> <?php $query2 = query_posts( array( ‘posts_per_page’ => -1, ‘post_type’ => array(‘team’) )); if($query2->have_posts()): while($query2->have_posts()): $query2->the_post(); ?> … Read more

Index.php is ordering posts strangely

You shouldn’t modify the main query like that. Instead, make a secondary loop: // The Query $args = array( ‘post_status’ => ‘publish’, ‘post_type’ => ‘post’, ‘orderby’ => ‘date’, ‘order’ => ‘desc’, ); $the_query = new WP_Query( $args ); // The Loop if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); // Do output … Read more