Get the current post parent category ID
How to get the current post parent category ID? Just copy the codes below and paste this your template.
global $post; $category = get_the_category( get_the_ID() ); $parent = $category[0]->term_id
This code is showing how to add a archive-child/archive-parent classes in Woocommerce product category pages using display_type option. add_filter( 'body_class', function( $classes ){ $object = get_queried_object(); if( get_woocommerce_term_meta( $object->term_id, 'display_type', true ) != 'subcategories' ){ $classes[] = 'archive-child'; }else{ $classes[] = 'archive-parent'; } return $classes; });
Override rtMedia media-gallery.php template into current WordPress theme is now not a problem. For example you have artist role in your users and you want different template for the artist role. This apply in `http://www.sample.com/members/artist/media/music/` page. add_filter( 'rtmedia_template_filter', 'rtmedia_template_filter_override', 10, 3 ); function rtmedia_template_filter_override( $template ){ global $bp; $role = get_user_meta( $bp->displayed_user->id, 'wp_capabilities', true );…
UPLOAD YOUR SITE INTO YOUR WEB HOSTING | WEB DEVELOPMENT | WEBSITE | XAMP | HOW TO CREATE A WEBSITE. EDUCATIONAL VIDEO PARA SA GUSTO TUMUKLAS NG MGA BAGONG KAALAMAN KUNG PANU GUMAWA NG WEBSITES. PAKI-SHARE PO VIDEO NG MARAMI TAYONG MATULUNGAN AT MABIGYAN NG ONLINE SKILLS. MARAMI PA TAYONG PWEDE IBAHAGI SA INYO. LINKS:…
In this first part of my debugging series, I dive into the issues plaguing my mobile navigation menu. From unresponsive toggles to hidden elements, join me as I walk through my thought process, inspect code, and start patching up what’s broken. Perfect for developers troubleshooting similar mobile UI headaches. #Debugging #MobileMenuFix #ResponsiveDesign #webdevolopment #FrontendDev #JavaScriptDebugging…
How to add @mention in Buddypress single media page (or rtMedia single page)? Copy the codes below to your functions.php add_filter( 'bp_get_activity_content', 'filter_bp_get_activity_content', 10, 1 ); function filter_bp_get_activity_content( $content ) { global $bp, $wpdb; $mention_link = ''; $mention_dummy = ''; $at_all = array(); $at_mention = ''; $at_space = ''; $at_text = ''; $mention_dummy = $content;…