WordPress.org

Ready to get started?Download WordPress

Forums

WP-TopBar
[resolved] How to Display on Categories Page (6 posts)

  1. lettereye
    Member
    Posted 2 years ago #

    Hello. I have a page where I do a query for a portfolio category and because of this, my page loses its page ID. I only want top bar on this particular page, though. Is there any other way to make only display on this category page or do I need to dive into the code to do a conditional for tag ID or something other.

    Thanks for you help with this in advance.

    http://wordpress.org/extend/plugins/wp-topbar/

  2. Bob
    Member
    Plugin Author

    Posted 2 years ago #

    I can see how to code that in a future version. Let me know what options you are looking for.

    To fix it yourself, look for the function wptb_inject_TopBar_html_js() in wp-topbar.php.

    Bob

  3. lettereye
    Member
    Posted 2 years ago #

    Sounds good, thanks. I actually simply solved via css visibility and showing on only the page I wanted. Its not ideal and I lose the animation, but it works.

    I guess if i edited your php file, i would just query the portfolio category instead of the post ID and then enter that category slug in the field where I would enter the page IDs, right?

    I will try that out, but would be great as a feature for future. A lot of sites I'm using like to use that portfolio category feature.

    Thanks for the reply.

  4. Bob
    Member
    Plugin Author

    Posted 2 years ago #

    I think you want to use something like:

    $show=0;
    foreach((get_the_category($thePostID)) as $category) {
    			if ($category->cat_ID = 1
    				$show=1
    		}
    if ( $show == 0)
        { return; }

    where "1" is the category you want to include.

    But I haven't tested this.

    Bob

  5. Bob
    Member
    Plugin Author

    Posted 2 years ago #

    Try version 3.10, just uploaded. It has a new Control tab with the options you wanted.

  6. lettereye
    Member
    Posted 2 years ago #

    This is very awesome. My issue was actually having a portfolio post category listed, but I noticed in the most recent update of wordpress that it is now treated as a page. Therefore, I can now just include the page ID in your interface. However, the feature you added is invaluable for non-pages that you want to display or not display...well done and thank you for the support and feature update!!!! I also like how you made it a separate tab for control. Well done with this plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags