Sidu_88
Forum Replies Created
-
Forum: Plugins
In reply to: [MyBookTable Bookstore by Stormhill Media] Removing "Find a Local Bookstore"To remove ‘Find a Local Bookstore’, just open ‘templates.php’ located inside plugins > mybooktable > includes folder.
Look for this line add_action(‘mbt_after_single_book’, ‘mbt_the_find_bookstore_box’); which can be found at the end of block of codes below the comment //single book hooks.
Delete the line of code add_action(‘mbt_after_single_book’, ‘mbt_the_find_bookstore_box’); and that is it. It worked for my test site.
This works for Ver. 2.0.2 For more detailed tweaks ask the author of this plugin.
Forum: Hacks
In reply to: Category sidebar for single posts belonging to their categoryThanks bcworkz …greatly appreciate it for your insight
I just found a solution borrowed from someone using wp_get_post_categories() like you suggested above which addresses the basic issue for assigning category specific sidebar for single posts. Yet there are some issues I still gotta deal with.
if ( is_category() ) {
$current_category_object = get_category( get_query_var( ‘cat’ ) );
} else if ( is_single() ) {
global $post;
$post_categories = wp_get_post_categories( $post->ID );
$current_category_object = get_category( $post_categories[0] );
}
get_sidebar( $current_category_object->slug );I wonder if there is a way assign category sidebar to single posts based on hierarchy if single posts are assigned to multiple categories where categories are separate and not equal in hierarchy.
Using the example from my previous post lets say single post ‘Diet Coke Is Awesome’ happens to be listed under categories ‘Cold Drinks’ and ‘Discount Supplies’ where ‘Cold Drinks’ is a sub-category of ‘Beverages’ while ‘Discount Supplies’ is a separate parent category.
- Discount Supplies
- Beverages
- Cold Drinks