• Hi,

    I would like to exclude the archive item from the sidebar on a certain page which is actually the one i use with the plugin from semiologic as a static front page…. could you help me please to do that?

Viewing 5 replies - 1 through 5 (of 5 total)
  • If you use the template home.php then this is easy. You simply make a new file and paste the sidebar code into it, then delete the call for the archive and then save this new file as sidebar2.php. Then, in your home.php, you replace the call for the sidebar with this:
    <?php include ('sidebar2.php'); ?>

    That will give you a sidebar that is exclusive to your homepage and that omits the archive.

    or you could add a conditional tag before the archive part in the sidebar..

    if (is_home()) { get_archives(); }

    Thread Starter ppoivre

    (@ppoivre)

    TKS Kickass, with semiologic plugin I didn’t created a home.php template. I just created a page with the slug home. I did a sidebar2.php and tried to call it in index.php or in page.php and no result…? Strange enough I agree…

    Silkjaer this conditional tag expands the number of months I already had in “Archive” displayed. This how I added it. is it right?

    <?php if (is_home()) { get_archives(); }wp_get_archives(‘type=monthly’); ?>

    ppoivre, all you have to do is make an exact copy of your page.php and name it home.php and follow the instructions above. Don’t put the call for sidebar2 in index or in page, that won’t work, and may give you a mess.

    I’m not sure that works with semiologic, though…. it’s almost another fork….

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Exclude an item from sidebar’ is closed to new replies.