Support » Fixing WordPress » Remove Sidebar on Category Pages

  • The link is just one of the category pages. I want the sidebar to not show up on all the category pages.

    I am not good at coding and I need some step by step help. I don’t know why it won’t let change the template for those pages.

    I also inserted CSS codes from the other boards, and they didn’t work at all, unless I put them in the wrong place, but I doubt it…..

    Help! 🙁

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz


    Trying to do so with CSS would be a mess, unless it’s OK to have a big blank space where the sidebar was.

    It’s not advisable to edit active themes. Switch to a different theme, then select your normal theme for editing. The template name you want is variable, but it’s often category.php. If your theme does not have one, it’s OK, more on this later. Switch back to your normal theme after editing.

    With the category.php template, there is usually a call to <?php get_sidebar(); ?>. Make it into a comment like so: <?php /* get_sidebar(); */ ?>. This change will not persist after theme updates. To have your changes persist, or if there is no category.php template, you should create a child theme.

    If there is no category.php template, copy your theme’s archive.php to your child theme folder and rename it category.php

    This advice is fairly generic. If you need more specific advise or your theme’s setup isn’t matching what I’ve said here, I suggest asking in the theme specific support forum.

    Try this code in Custom CSS

    @media only screen and (min-width: 1024px) {
    	body.category #primary { width: 100%; padding: 0 50px; }
    	body.category #secondary { display:none; }

    Also, if your site has some kind of caching (web optimization) going on, please remember to clear cache after making changes.

    To the first person thanks for your help but I am so lost it’s not even funny.

    Second person. I put it in but nothing happened.

    Oh i fixed it I put a close } at the end and it worked!!! OMG THANK YOU SO MUCH!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.