Ready to get started?Download WordPress


If a category is clicked on sidebar, page formatting error ensues (6 posts)

  1. Stryke11
    Posted 9 years ago #

    Hi, I've been searching for awhile and can't seem to find a similar question, sorry if there has been one!

    I never use my category links in the sidebar. They aren't useful to me but I leave them on there in case they're useful to anyone else. Just randomly today I clicked on one and it led me to a page with a messed up layout. Specifically, the text that belongs in the footer was placed in the lower sidebar, and from that point downward on both the main textarea and sidebar the background color was broken.

    This only happens when you click a category. Going back in the archives does not cause this problem, nor clicking on a specific post. The problem is repeated if you click the category link (i.e posted in "general") below the post, as well as the sidebar link.

    Now I can just get rid of categories, it wouldn't bother me too much, but for full functionality, if there's some way I can fix it that would be great.

    My page url is http://www.cruzcontroller.com/blog/ and you can see the error by clicking on any of the categories on the sidebar or by going here: http://cruzcontroller.com/blog/index.php?cat=3



  2. jbbrwcky
    Posted 9 years ago #

    Check to see if you have a category.php.

    If not, copy your main layout page (index.php for example) to category.php.


  3. moshu
    Posted 9 years ago #

    Try to remove the comment-out sign from your sidebar or footer

    <!-- <=== THIS ONE
    <center><a href="http://www.spreadfirefox.com/...
    <br />
    It's not closed.

    Edit. It might also be in the archive.php.

  4. Stryke11
    Posted 9 years ago #

    I see what you're talking about Moshu, but I can't seem to find that <!--.

    It isn't in the sidebar file (as the firefox box comes up fine on the main page) and I couldn't find it in footer, archive, or archives.

    Creating a copy of index.php and renaming it category.php doesn't do anything that I can see.

    Hmmm. Why would it just randomly insert a <!-- when you go to category view and nowhere else? It isn't even a transition between .php's, it right in the middle of two parts of my sidebar.

  5. moshu
    Posted 9 years ago #

    It cannot be in the archives.php - that's a Page template.
    It has to be in archive.php (no S for plural!) or sidebar or footer. Another option would be if you have a category.php in your theme - it should be there. (See Template Hierarchy in Codex:
    http://codex.wordpress.org/Template_Hierarchy#Category_Page )

  6. Stryke11
    Posted 9 years ago #

    Ok, I found a solution, but I can't imagine why it worked. In my sidebar.php file there was a statement:
    <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
    <?php get_links_list(); ?>

    and I had that statement commented out with <!--, but it was ended in --> so it shouldn't have been a problem, and it wasn't on the main page but for some reason un-commenting it changed nothing on the main page but fixed the category page. Go figure...

    Thanks for the suggestions, and thanks Moshu for leading me in the right direction.

Topic Closed

This topic has been closed to new replies.

About this Topic