Submit Your Article Forum Rules

Results 1 to 3 of 3

Thread: Conditional Tag tip and help please?

  1. #1
    WebProWorld MVP inertia's Avatar
    Join Date
    Apr 2006
    Posts
    1,194

    Conditional Tag tip and help please?

    Here's a tip and a question in one...

    I use this bit of code quite a lot:

    Code:
    <?php if (is_home()) : ?>
    <h1>title</h1>
    <p>content</p>
    
    <?php endif; ?>
    ...which is all you need if you want to hard code some content into the home page which will not appear on any other page which uses the same template.

    That works fine but it doesnt stop the content appearing on the other "older posts" pages. Does anyone know how or what codex i need to ensure that content only displays on the very top page?

    For people that havent got that into hard coding on wordpress check this out: Conditional Tags wordpress Codex
    My LinkedIn Profile -- Lancaster Builder

    Twitter: @mattbennettseo

  2. #2
    WebProWorld MVP wige's Avatar
    Join Date
    Jun 2006
    Posts
    3,138

    Re: Conditional Tag tip and help please?

    Are you setting a static home page, or a home page that lists post content? Also, what version of Wordpress is running on the site using this code and experiencing this issue?
    The best way to learn anything, is to question everything.
    WigeDev - Freelance web and software development

  3. #3
    WebProWorld MVP inertia's Avatar
    Join Date
    Apr 2006
    Posts
    1,194

    Re: Conditional Tag tip and help please?

    Its version 2.7 and im using it in standard blog setup.
    My LinkedIn Profile -- Lancaster Builder

    Twitter: @mattbennettseo

Similar Threads

  1. conditional ie - can't get it to work:(
    By ristenk1 in forum Graphics & Design Discussion Forum
    Replies: 15
    Last Post: 04-15-2009, 03:53 AM
  2. PHP Conditional Statement - Help!!
    By MuNKyonline in forum Web Programming Discussion Forum
    Replies: 9
    Last Post: 03-07-2007, 06:15 AM
  3. Conditional Redirect with Javascript..
    By steve0 in forum Web Programming Discussion Forum
    Replies: 9
    Last Post: 07-26-2006, 08:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •