basic if statement
-
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,
SamTITLE EDIT: Couldn’t spell.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘basic if statement’ is closed to new replies.