Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1184101
    inlifestyle
    Participant

    i placed that code and it didnt work. I tried creating a few test posts with categories and sidebars setup. Can you take a look?

    Thanks!

    #1184363
    Paul R
    Moderator

    In that case, please provide us your ftp login in private reply.

    Thanks

    #1187072
    inlifestyle
    Participant
    This reply has been marked as private.
    #1187521
    Rad
    Moderator

    Hi there,

    Would you mind providing your admin login credentials as well? The login you provided redirects to a member dashboard.

    Thanks!

    #1187935
    inlifestyle
    Participant
    This reply has been marked as private.
    #1188444
    Rad
    Moderator

    Hi there,

    It still the same, it won’t allow me to access the admin dashboard. It redirects me to different URL of the member dashboard.

    Is there any special procedure?

    Thanks!

    #1192403
    inlifestyle
    Participant
    This reply has been marked as private.
    #1193224
    Lely
    Moderator

    Hi There,

    I am able to login and check. As stated on the thread:

    With this customization, it will allow you to set your custom sidebar per category. You may add or edit your category at Admin > Posts > Categories and set your sidebar. If there is no sidebar, then it will use main sidebar. Please also note that if your items has multiple category, then it will pickup the last category and use its sidebar. See attached screenshot on how to select category.

    #1195820
    inlifestyle
    Participant
    This reply has been marked as private.
    #1196340
    Rad
    Moderator

    Hi there,

    That post has multiple categories, and it’s not possible to have multiple sidebars on the same page as well. Hence, by default, it will only pick the sidebar from the first category assigned to it. It happens to be the Compliance category ( http://dmec.org/wordpress/wp-admin/term.php?taxonomy=category&tag_ID=150&post_type=post ). And it the assigned sidebar is set to default (Main Sidebar) which is empty.

    Please assig a different sidebar for Compliance category.

    Make sure the sidebar is implemented on the front as well, like from here https://community.theme.co/forums/topic/create-sidebar-for-post-category/page/3/#post-244194

    Thanks!

    #1196368
    inlifestyle
    Participant

    I added that code into the functions.php file when this first started.

    I did however assign a category for the compliance category and still nothing….Am i missing something on that thread?

    #1196806
    Rad
    Moderator

    Hi there,

    I checked your files through FTP and the only implemented code is for the backend. It has another set of code to display it on the front end. Like from the last URL that I provided, it’s the same thread but just different page number. Please check the discussion 🙂

    Thanks!

    #1197331
    inlifestyle
    Participant

    Are you referring to the wp-single.php? I added that code in and still nothing. Can you be more direct in what is needed it help us both out!

    Thanks!

    #1197693
    inlifestyle
    Participant

    I had to remove the wp-single.php file because it was causing a blank left sidebar….

    #1197891
    Rad
    Moderator

    Hi there,

    It doesn’t need to be the wp-single.php, I added this code to your child theme’s functions.php

    add_filter( 'ups_sidebar', 'ups_display_category_sidebar', 99 );
    
    function ups_display_category_sidebar ( $sidebar ) {
    
      
    
    if ( is_singular( 'post' ) ) {
    
        $terms = get_the_terms( get_the_ID(), 'category' );
        
    
        if ( isset( $terms ) && count( $terms ) > 0 ) {
    
              $term = array_pop( $terms );
              $setting = get_option( "taxonomy_".$term->term_id );
              $sidebar = $setting['category-sidebar'];
    
        }
    
    }
    
    return $sidebar;
    
    }

    And it will pick the sidebar from the very last category that is assigned to your post.

    Cheers!

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