Hide #navbelow in certain categories

  • Unknown's avatar

    Is it possible to choose which categories I want to display the post-navigation via CSS? Or do I have to write each post a specific display none? Thanks!

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi,

    To clarify, did you want to hide the #nav-below navigation links on certain Category page? Or certain other pages?

    There’s no admin option inside WordPress to do exactly that, so you’re correct that you will have to write a specific targeting with CSS to hide those on certain pages.

  • Unknown's avatar

    Yeah that’s right. I don’t want it to show on all pages of a specific category i.e “inverso” and “verso”. I only find it necessary to have a navbelow on the “instantaneo” category. What I’ve been doing so far was writing each post of those categories a “hide navbelow” but after a few new posts I stopped it. So I was wondering if it was possible to write a code that worked for a whole category (all of its posts)

    Thanks!

  • Unknown's avatar

    The following hides the nav-below on all category pages and then makes it visible on the instantâneos categoy.

    .category #nav-below {
        visibility: hidden;
    }
    .category-instantaneos #nav-below {
        visibility: visible;
    }
  • Unknown's avatar

    I’m not sure why but it didn’t work. The post-navigation is still there… :(

  • Unknown's avatar

    I’m not sure why but it didn’t work. The post-navigation is still there… :(

  • Unknown's avatar

    It was a problem with the selector. This is what I saw in your custom CSS:

    .category-instantâneos #nav-below

    It had to be this instead (note the “a”):

    .category-instantaneos #nav-below

    I went into your custom CSS and fixed it for you.

  • Unknown's avatar

    Sorry for the misunderstanding. I tried to change the A to see if it would work, but it didn’t. It still shows the nav-below, though…

  • Unknown's avatar

    Then I’m not understanding what you want. What I understood was you wanted the “nav-below to be gone from verso and inverso, and have it show in instantaneos.

    verso category page ( http://revistausina.com/category/verso/ ): https://i.cloudup.com/dKak9FvoOs-2000×2000.png

    inverso category page ( http://revistausina.com/category/inverso/ ): https://i.cloudup.com/ARgIJyeOyY-2000×2000.png

    instantaneos category page ( http://revistausina.com/category/instantaneos/ ): https://i.cloudup.com/NWm3IiDGO7-2000×2000.png

    Are you also wanting it gone on the sub categories under verso and inverso – in the dropdown submenu?

  • Unknown's avatar

    My sincere apologies. I had no idea that by nav-below it also meant the “previous/next pages” on the categories. What I’ve been trying to say is “post-navigation” instead of “nav-below”.

    I used these instead:

    .post-navigation {
    visibility: hidden;
    }

    .category-instantaneos .post-navigation {
    visibility: visible;
    }

    The first one worked fine, all the post-navigations were gone. But the exception under “category-instantaneos” did not. It’s not showing inside a instantaneos post the next/previous post where it should…

    I’m sorry for the trouble!!

  • Unknown's avatar

    Ah, ok now I understand. Single post pages do not have a category body class defined, so we can’t limit by category. The only way to do it would be to do it by post ID, and that means you have to write a CSS rule that would have the post ID for each and every individual post in instantaneos category where you wanted the post navigation to show. Each time you added a post to that category, you would have to go in and modify the CSS rule and add the post ID class for that post to that rule.

  • Unknown's avatar

    That’s alright, I’ll work on that. One more thing: why does my post-navigations look different if I inspect the page?

    how it looks on every page:
    http://i58.tinypic.com/2vmtycg.png

    after I inspect, this happens:
    http://i62.tinypic.com/33neofk.png

    Do you know why? If it’s possible, can it be the second one by default?

    Thanks!

  • Unknown's avatar

    I’ve seen that with the web inspector too, and I think it might be a bug. There is nothing really that should cause that as it is presenting a view the HTML and the CSS.

    On another note, you have the width of .entry-content set at 90% and #primary (a parent div) set at 75% which means that .entry-content extends outside the right margin of #primary, which is what is shifting the comments and nav-below to the left.

    When I narrow down my browser window all sorts of mischief happens. When I get down to around 480px in width (the width of an iPhone in landscape orientation) your videos are completely cut off on the right side and basically un-viewable and it also cuts off your text on the right.

    I’ll look into fixing this for you but it might take a little time to figure out what all is causing the issues.

  • Unknown's avatar

    Thanks a lot!!! Should I do something about the .entry-content width? I’m not sure why I did that. I’ve been learning to set my CSS by trial and error…

  • The topic ‘Hide #navbelow in certain categories’ is closed to new replies.