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

samcrawshaw on "basic if statement"

$
0
0

Yo mo fo's,

I've done a duplicate post over in the Plugins section.

I've flummoxed myself with an if statement. Here is my code:

if (is_page(64)){
	$recent = new WP_Query("page_id=64");	//Define the post
	while($recent->have_posts()) : $recent->the_post();	//Start the loop
		the_content();	//Get the content
		endwhile;}	//End loop

When I run the statement I get the 404 page. It pulls in the post out of the if statement.

I am using wp_nav_menu() to call in the navigation. Should this matter?

It did work at one point but I'm struggling to fathom what I did wrong. I am also using the wp_reset_query in the footer.

The url reads /contact but is pulling in the 404 page.
N.B. 64 is id of my contact page (not post).

Thanx for looking,
Sam

TITLE EDIT: Couldn't spell.


Viewing all articles
Browse latest Browse all 8245

Trending Articles