• Just switched from MT to wordpress (yes, another one of those WP newbies, sorry ) and I’ve already run into a bit of a problem – I’m using WP as a news publisher and so it should display the latest news on my index.php site. Above the news is a little “intro” text that should only appear on that index file. But since the index file also works as sort of a template if I understand it correctly ( calling the individual posts via /index.php?p=1) I of course have that intro text on EVERY page/post now (single-post pages I mean) which is not what I want.
    Is there a way around it? Setting some OTHER file (like news.php) to be that “template” file and not that index.php ?
    sorry if the answer is kinda obvious, I’m still in the learning stages ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Anonymous

    thanks, that was nice and easy ?? Thanks for the quick help, worked exactly like I wanted it to!

    Thread Starter Anonymous

    Sorry to bump this, but can someone post the exact code for this? I’ve been playing around with this conditional code for 2 hours and still can’t get what I want to happen. I have a welcome blurb and then a “latest news” heading on my main index page. I only want that to show up on the index page and not the extended entries page. Can someone help? I tried doing a search and trying to write my own conditional, but I’m far too much of a newbie to do this on my own. Thanks, in advance!

    i’m in the same boat.. i’d very much like to know this as well. ??

    Something like this is one easy way of doing it…


    <?php if (!$single) { ?>
    Stick your intro code here and anything else you don't want on the individual entry pages
    <?php } ?>

    thank you for that, Korgan.. it helps.. the text does not show up on individual-entry-permalinked pages
    –but it still shows up outside the first/main pages, such as on monthly archive listings.. is there a way around that?

    There are several various booleans that you can use for this. $single is just one of them.
    $m $monthnum = the month of the post(s) (so you could use !$monthnum)
    $cat = categories
    So you could use those as well to ensure that it didn’t show up on Monthly archive or Category archive pages. There are many others available as well, have a look through wp-blog-header.php for an idea of others.

    thanks Korgan.. that’s also helpful.. i think it(php)’s starting to seep in slowly, but not quite clicked yet for me.. i’ll keep paying attention.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘“intro” text just on index page, not on individu’ is closed to new replies.