Helping ordinary people create extraordinary websites!

Go Back   Web Development Forum > Website Programming > Server-Side Scripting
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-21-2007, 01:07 AM
ryanhellyer's Avatar
Super Moderator
 
Join Date: Dec 2007
Posts: 708
Default WordPress PHP theming issues

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-09-2008, 07:05 PM
BigAlReturns's Avatar
Moderator Extraordinaire!
 
Join Date: Dec 2007
Location: The Wirral, England
Posts: 291
Send a message via MSN to BigAlReturns
Default

Are you still looking for a solution here Ryan? The page is removed now but what output did it show? i.e. which of the statements from the above 2 blocks was being executed? I take it the is_page('dihl') was expected to return true. going by the link you gave?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forum theming ryanhellyer Forums/Blogs/Social Networks 0 12-30-2007 01:47 AM
PHP Navagation Problems PLEASE HELP pootytang69 Server-Side Scripting 2 12-11-2007 12:37 AM
Best php script site? reach2seo Server-Side Scripting 6 12-10-2007 01:32 PM
How to browse php nguyen van viet Server-Side Scripting 3 10-23-2007 05:03 AM
problem with mysql and php dharshini Server-Side Scripting 1 07-25-2007 02:43 AM


All times are GMT -5. The time now is 03:15 AM.


Website Design by Ducani Media Group
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.