The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Help with an if else statement

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #28918

    Hey there, my lack of php knowledge has got me stuck on something I want to do…

    I currently have this code to show a featured post…

    <?php query_posts(‘showposts=1&category_name=Featured post’); ?>
    <?php include(‘featured_posts.php’);?>

    So, if a post is categorized as ‘featured post’ show featured_post.php. May seem weird but I’m using thematic and my functions.php file is getting huge so I took out this loop and put it in a seperate file.

    Okay, what I actually want to do is – if a post has cat of ‘featured post’ get the featured_posts.php file, else show a standard loop.

    Thanks for any help.


    Rob MacKay

    I have used the in category tag before – have a look and see if it makes anything clearer … n_category

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.