Tagged: x
-
AuthorPosts
-
April 15, 2016 at 4:54 am #884005
malingroupParticipantSupport,
I have followed and implemented the codes as listed in this thread: https://community.theme.co/forums/topic/create-sidebar-for-post-category/
However i do not get an option under categories to select a sidebar.
Appreciate your assistance.
April 15, 2016 at 4:55 am #884006
malingroupParticipantThis reply has been marked as private.April 15, 2016 at 3:44 pm #884824
JadeModeratorHi there,
Thanks for writing in. As the thread you have referred to is quite long, would you mind pointing out which part of the thread you are pointing to specifically as I am not certain based on what you mentioned. Thank you.
April 18, 2016 at 4:58 am #887918
malingroupParticipantHi,
The first support reply on that thread included coding to modify the functions.php and wp-single.php to give the ability to select a sidebar when defining a category, thus giving category specific sidebars for individual posts. I have implemented this coding and i do not get this ability when creating a category.
April 18, 2016 at 7:37 am #888152
Paul RModeratorHi,
The code is quite old and will not work in the latest version of x.
You can try this code instead. Add this in your child theme’s functions.php file
add_filter( 'ups_sidebar', 'my_blog_sidebar', 9999 ); function my_blog_sidebar ( $default_sidebar ) { if(is_category( '35' )){ return 'ups-sidebar-ballast-blog'; } return $default_sidebar; }35 is category id of Ballast Blog category and ups-sidebar-ballast-blog is your sidebar id
http://screencast.com/t/yPPVXL3TBXI
If you need to add another category, you can add another elseif statement
eg.
add_filter( 'ups_sidebar', 'my_blog_sidebar', 9999 ); function my_blog_sidebar ( $default_sidebar ) { if(is_category( '35' )) { return 'ups-sidebar-ballast-blog'; } elseif (is_category( '36' )) { return 'ups-sidebar-blog'; } return $default_sidebar; }https://community.theme.co/kb/how-to-locate-category-ids/
Hope that helps.
April 21, 2016 at 7:37 am #893544
malingroupParticipantHi thank you for the detailed reply. I tried this code in my child theme’s functions.php but it still does not show the correct sidebar for individual posts relevant to that specific category?
April 21, 2016 at 5:29 pm #894399
JadeModeratorHi there,
Please provide us with your FTP details so that we could test it.
Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.
April 21, 2016 at 5:32 pm #894402
JadeModeratorHi there,
Please provide us with your FTP details so that we could test it.
Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.
April 22, 2016 at 2:51 am #894922
malingroupParticipantThis reply has been marked as private.April 22, 2016 at 6:32 pm #896024
RadModeratorHi there,
The code above is only to display the specific sidebar to a specific category page. What you’re trying to achieve is display specific sidebar to post that belongs to a specific category.
The thread you provided has the correct implementation, but it’s too old and long discussion. Please follow the discussion and implement the codes that are mentioned. Then Let me know and I’ll check what else needed to update to match the recent X’s templates.
Thanks!
April 25, 2016 at 2:49 am #898225
malingroupParticipantHi,
I have now implemented the codes from the previous thread. Appreciate if you can check what else is needed to get this code working with the recent X templates.
Many thanks!
April 25, 2016 at 11:59 pm #899709
Paul RModeratorHi,
I was able to fix it, kindly check on your end.
Thanks
April 26, 2016 at 8:45 am #900362
malingroupParticipantthank you very much. Your support is second to none..!
April 27, 2016 at 2:29 am #901578
LelyModeratorYou’re welcome!
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-884005 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
