I've been having trouble with a particular problem with a site I'm creating with WordPress for a while now. My programming skills are negligible so I'm hoping someone will be able to help me out with this.
What I'm trying to do, is to pull posts from a WordPress category on my site via query_posts to a particular page via an IF is_page statement. This works fine, but when I use an IF statement to display a particular piece of code, the IF statement is not obeyed. It works when query_posts is not used, but not when query posts is used
The code is in my page.php file. Here's a chopped down version of it:
Code:
<?php
if (is_page('dihl')) {
query_posts('category_name=Dunedin Ice Hockey League&showposts=10');
while (have_posts()) : the_post();
the_excerpt('');
endwhile;}
?>
<?php
if (is_page('practices')) {echo 'Practice';}
elseif (is_page('dihl')) {echo 'DIHL';}
else {echo 'Not practices or DIHL';}
?>
I'm certain whatever it is that I'm doing wrong is stupidly obvious, but I can't figure out what it is.
The test page I'm trying to get this to work on is here ...
http://getasportsite.com/dunedinicehockeynew/dihl/. The forum section below the news on the right is NOT meant to be on the page.