I’m trying to minimize my code and have put together this little snippet, it doesn’t seem to work however. What am I missing?
query_posts( 'year=2011' );
if ( have_posts() );
while ( have_posts() );
echo 'test';
endwhile;
wp_reset_query();
endif;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think that your problem is the question mark at the end of the if and at the end of while. IMy opinion is that you need a colon “:”