Forums

[resolved] hidden comment showing up on archive page (4 posts)

  1. eryan215
    Member
    Posted 2 years ago #

    I did not want to use categories for the time being, so I suppressed the display so I can enable it later when I have more entries.

    In the sidebar.php I did this:
    <!-- Categories information is disabled. Uncomment and fill in your details if you want to use it.
    <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>

    <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
    -->

    On my homepage, this works just fine; you cannot see the categories list on the sidebar at all. However, all the above code and commentary--which I thought I'd hidden--shows up in the sidebar when you go to the archive page. How do I get it so it is hidden on the archive page, too????

  2. Ben Sutcliffe
    Member
    Posted 2 years ago #

    Are you using a widgetised sidebar?

    Put the comment tags <!-- ... --> around the actual code that generates the the categories. I'm not sure why you're isolating the final --> with that PHP if statement. Or, delete the code (only the wp_list_categories(...) bit) and put it in to a text file for later use.

    Also, how are you calling your sidebar from your archives page? Is it a page template?

  3. eryan215
    Member
    Posted 2 years ago #

    Thanks. I don't know anything about widgets. I don't know php at all. I am mostly guessing about where to place and insert things based on my small knowledge of html and css. I just try stuff until it works. So most of your questions I cannot answer.

    However, you have given me ideas to go on; I will move the tag up away from the if statement or file the code in a text file for later use. Those things, I understand.

  4. eryan215
    Member
    Posted 2 years ago #

    I worked! I moved the closing tag up so it ended before and didn't isolate the php if statement. Now the comment is hidden again. Thanks. I learned something!

Topic Closed

This topic has been closed to new replies.

About this Topic