[resolved] hiding content on the homepage when viewing full/permalink/comment page (2 posts)

  1. brunning
    Posted 10 years ago #

    maybe there's a better way to do this, but...

    i've set up my index page with the WP blog entries showing in one div, and other stuff in other divs.

    when you click to the permalinked page, comments, etc, the same index page is used to show the full article with comments.

    this is great, but when viewing the full blog entry, i want to hide the "other stuff".

    is there a way, using wp tags or other php, i can identify when the page is in the permalink/comments state and not show certain content?

    can i check for some variable or something?

    PHP_SELF doesn't cut it, as it's always the same file, index.php.


  2. moshu
    Posted 10 years ago #

    For the first case (w/ "other stuff") use a home.php template. WP recognizes it and displays it instead of index.php.
    For the single post view - use a single.php in your theme.
    (Note: Leave the index.php there, it might be used for other purposes > see Template_Hierarchy)

Topic Closed

This topic has been closed to new replies.

About this Topic