Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1221812
    Wildwood
    Participant

    Hi,

    I have followed the instructions to add a sidebar to the portfolio pages as described here:

    https://community.theme.co/forums/topic/adding-sidebar-to-single-portfolio-pagepost/

    HOWEVER … my client has MANY sidebars and I am unable to select a sidebar for the portfolio pages. (see attachment)

    Please let me know how to assign a specific sidebar to portfolio pages.

    Thank you!

    #1221960
    Christopher
    Moderator

    Hi there,

    Please add following code in child theme’s functions.php file :

    add_filter( 'ups_sidebar', 'portfolio_sidebar', 9999 );
    
    function portfolio_sidebar ( $default_sidebar ) {
    if ( x_is_portfolio_item() ) return 'ups-sidebar-custom-sidebar'; //Must match the ID of your target sidebar
    return $default_sidebar;
    }

    Hope it helps.

    #1231783
    Wildwood
    Participant
    This reply has been marked as private.
    #1231896
    Thai
    Moderator

    Hi There,

    In this case, would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link login to your site
    – WordPress Admin username / Password

    Don’t forget to select Set as a private reply. This ensures your information is only visible to our staff.

    Thanks.

    #1236002
    Wildwood
    Participant
    This reply has been marked as private.
    #1236006
    Wildwood
    Participant
    This reply has been marked as private.
    #1236304
    Rue Nel
    Moderator

    Hello There,

    You can use Christopher’s solution by using this code in your child theme’s functions.php file

    add_filter( 'ups_sidebar', 'portfolio_sidebar', 9999 );
    function portfolio_sidebar ( $default_sidebar ) {
      if ( x_is_portfolio_item() ) return 'ups-sidebar-all-products-batteries'; //Must match the ID of your target sidebar
      return $default_sidebar;
    }

    Hope this helps. Please let us know how it goes.

    #1238014
    Wildwood
    Participant

    Hi,

    Sorry, Christopher’s solution did not help.

    I am still unable to assign a specific sidebar to a specific portfolio page.

    Please advise.

    Thank you.

    #1238090
    Thai
    Moderator

    Hi There,

    I checked your single portfolio item page, I could see that the side is displaying correctly:

    Concorde Batteries

    http://i.imgur.com/lFBkshK.png

    http://i.imgur.com/Df6BuTG.png

    Could you please double check on it?

    Thanks.

    #1238133
    Wildwood
    Participant

    Yes, this is the default sidebar.

    The request above is to apply individual sidebar to various portfolio pages.

    I am unable to ASSIGN the sidebar to a portfolio page as I am able to do with all other pages/posts.

    Thank you.

    #1238764
    Christopher
    Moderator

    Hi there,

    Adding php code in child theme’s functions.php file won’t list portfolio items under posts and pages box. It let you to choose one sidebar like ups-sidebar-all-products-batteries and display it on all portfolio pages.

    Hope it helps.

    #1239207
    Wildwood
    Participant

    Hi Christopher,

    No, this doesn’t help. I am sorry that I was not clear.

    How can a specific sidebar be assigned to the portfolio pages in the same way sidebars can be assigned to posts and pages.

    Is there anyway to include the portfolio pages to the SIDEBAR selection?

    Thank you very much.

    #1240133
    Lely
    Moderator

    Hello There,

    That is how wordpress works by default. Portfolio item is a custom post type and it is not included on the list that you need to tick for custom sidebar to be available. It can be achieve by customization, unfortunately, it is outside the scope of our support. Thank you for understanding.

  • <script> jQuery(function($){ $("#no-reply-1221812 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>