Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

chrisvallleyoc on "Removing Posts from the_loop?"

$
0
0

I have a unique circumstance where I'm trying to hide specific custom posts from one of the loops in my template. It was fairly easy to hide them with an if statement in the loop to prevent them from being shown, but the pagination still counts them, so I have erroneous blank pages.

Currently I'm using:

if (have_posts()) : while (have_posts()) : the_post();
	if (($post->post_parent) ) {
		continue;
	} else {
		[Code to display posts]
	}

Viewing all articles
Browse latest Browse all 8245

Trending Articles