-
Author
-
December 11, 2015 at 15:43 #92619carlostincaParticipant
Hi,
We have two post types with his respective taxonomies in them. Each one have a taxonomy and post archive page, but we want to replace the Main Sidebar associated to that page (we used the archive template of Kleo) for one that we created.
How we can do this?
Thanks,
Carlos
(sorry about my english)
December 11, 2015 at 18:15 #92668RaduModeratorHi,
Add this snippet to your wp-content/theme/kleo-child/functions.php
COPY CODEfunction add_before_my_siderbar() { ?> < ?php if (is_archive()) { ?> <div class="sidebar sidebar-main col-sm-3 sidebar-3rr"> <div class="inner-content widgets-container"> < ?php dynamic_sidebar('for home'); ?> </div><!--end inner-content--> </div><!--end sidebar--> < ?php } ?> < ?php } add_action( 'get_sidebar', 'add_before_my_siderbar' ); function add_before_my_siderbar() { ?> < ?php if (is_archive()) { ?> <div class="sidebar sidebar-main col-sm-3 sidebar-right"> <div class="inner-content widgets-container"> < ?php dynamic_sidebar('For Custom Taxonomy'); ?> </div><!--end inner-content--> </div><!--end sidebar--> < ?php } ?> < ?php } add_action( 'get_sidebar', 'add_before_my_siderbar' );
Cheers
RAdu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionDecember 11, 2015 at 20:05 #92722carlostincaParticipantI getting an error of unexpected end of file, even fixing the extra space and things. Is there any error on the code that im not seeing?
Also, how can i assing a custom sidebar for a custom taxonomy or post archive?, because there is only about custom taxonomy. Just to make it clear:
HotelArchiveSidebar -> HOtel Post Archive and Hotel Category Taxonomy.
Activities -> Activities Post Archive and Activities Category Taxonomy.Thanks,
CarlosDecember 14, 2015 at 17:00 #93150RaduModeratorIn this case i suggest you to look at this plugin it seems that its ok for what you need.
https://wordpress.org/plugins/content-aware-sidebars/
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.