I think somewhere I must have mixed up some code/syntax because my conditional isn't working correctly.
What it is supposed to do is show a post blurb on the home page in one spot if it's the home page. If not, then show a form. Currently, it is showing the form on the home & other pages, and the post blurb isn't showing.
Here is the code:
[Code moderated as per the Forum Rules. Please use the pastebin]
What'd I do wrong :( ?
Changing it and simplifying it down to:
<?php if ( is_home() ) { ?>
Test
<?php }
else { ?>
<div id="resources">
Test 2
</div><!-- end resources -->
<?php } ?>
Test 2 shows on homepage :/ ...
http://codex.wordpress.org/Function_Reference/is_home
alternatively try:
http://codex.wordpress.org/Function_Reference/is_front_page
if your site is running other queries before this conditional statement, the querystring might be distorted - try to add wp_reset_query(); before the if statement.
Well, digging around I found this, which says, just add <?php wp_reset_query(); ?> before your conditional and it will reset all previous queries and make your conditional work.
And it worked :D
Hope that helps someone else!
-Lindsey
I am having problems with this as well and wp_reset_query won't work either.
I am on WP 3.1