• Seeing as you guys helped me out so much with my permalinks and the ‘if_single’ tag, I thougt someone must know how to do this:
    Currently I have two includes… a main include which is my index page, and a single include which is my single article template. The problem is, when I try to browse by catagory, it returns me to my main page including all the stuff I don’t want to be there. Anyone know what I’m talking about?
    Visit my site: http://lexmedia.dnsalias.com/ for more info.
    Click the article, then click the link which should take you to the general articles catagory. You’ll see what I mean.

Viewing 5 replies - 1 through 5 (of 5 total)
  • the is_single() function returns TRUE for single pages… individual archives. The category archives return FALSE, just like the main page. If you only want stuff showing on the main page, (and you’re using wp 1.3, as I assume you are if you are using is_single()) you can use is_home() to test if it is the main page.

    Thread Starter lexmedia

    (@lexmedia)

    I’m actually only using version 1.2… Ok, so what you’re saying is I can have is_single go to a single post template, is_home to go to the home page, or else to go to all other catagory pages, etc?

    Thread Starter lexmedia

    (@lexmedia)

    Here’s what I have so far…
    <div id=”wrapper”>
    <?php
    include(“heading.php”);
    ?>
    <?php
    ##I WANT SINGLE ARTICLES HERE if ($single)
    {
    include(“single.php”);
    }##I WANT THE HOME PAGE HERE
    {
    include(“main.php”);
    }##I WANT ALL OTHER BLOG-RELATED PAGES HERE##
    else{
    include(“articles.php”);
    }
    ?>
    </div>

    Thread Starter lexmedia

    (@lexmedia)

    This DOES NOT WORK. Could anyone revise this code to work? Thanks a lot. For reference:
    http://lexmedia.dnsalias.com/

    Thread Starter lexmedia

    (@lexmedia)

    Bump

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Templates and PHP Includes’ is closed to new replies.