WordPress.org

Ready to get started?Download WordPress

Forums

Different content on home page versus displaying s (3 posts)

  1. Simon Hampel
    Member
    Posted 10 years ago #

    I want to add content outside my blog posts on my home page that is not displayed when a user shows just a single post or performs a search to get a list of blog entries etc etc.
    Basically, I have added some text between the h1 tag and the div id="content" tag in index.php so that it is displayed before we go into the loop to show each blog post.
    But this causes it to also show up when displaying just a single blog post or when searching etc.
    Any way to hide it when not showing the default view ? A php function call that I've missed perhaps ?

  2. bestfoot
    Member
    Posted 10 years ago #

    You can probably hard code a conditional into your php. If not x then y in essence. Could help you if you visit me in our chat over at http://htmlfixit.com probably.

  3. chuckg
    Member
    Posted 10 years ago #

    It sounds like you're looking to show certain content when you're on the the main index, but not when you're browsing anywhere else. The if statement you're looking for is probably best illustrated here, but applied ina different way:
    http://wiki.wordpress.org/index.php/show-one-category-on-front-page

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.