Product categories WordPress codex
How to get current product category slug?
global $wp_query; echo $wp_query->query_vars['product_cat'];
How to get current product category slug?
global $wp_query; echo $wp_query->query_vars['product_cat'];
≡ read more → » ✌ ☯ ☮ ಠ_ಠ :B ☮ ✿ ✈ ♋ ☠ ☯ ♥ ✌ ✖ ☢ ☣ ☤ ❤ ❥ ❦ ❧ ♡ ✗ ✘ ♒ Ω ♦ ♠ ♥ ♣ ♢ ♤ ♡ ♧ ✦ ♔ ♕ ♚ ♛ ★ ☆ ✮ ✯ ☾ ☽ ☼ ☀ ☁ ☂ ☃…
How to get the category ID of the current post? Just copy the codes below and paste it into your .php file. $category = get_the_category( get_the_ID() ); $category_ID = $category[0]->term_id; Another problem is, what if the category ID is a sub category and you need the parent category ID? For Example, the current category ID…
Theme my login (TML) or WordPress login form does not show the login error. This error display after you have login the wrong username or password. The reason why it is not showing is the current login form action URL and your current page has different URL. Theme my login (TML) is using /login/ page…
Step 1 Think about the name of your plugin. Step 2 Example is Shortcode URL plugin. Create a shortcode-url folder name inside of wp-content/plugins/. Step 3 Create shortcode-url.php file inside wp-content/plugins/ folder and put the codes below inside of your shortcode-url.php file. <?php /** * Plugin Name: Shortcode URL * Plugin URI: https://www.anthonypagaycarbon.com/ * Description: Shortcode URL is…
Where ‘style-woocommerce’ is the ID of your stylesheet and get_stylesheet_directory_uri().’/style-woocommerce.css’ is your .css DIR. wp_register_style( 'style-woocommerce', get_stylesheet_directory_uri().'/style-woocommerce.css' ); wp_enqueue_style( 'style-woocommerce' ); Function below is for woocommerce page css only. This will show on woocommerce pages else is not. add_action( 'wp_enqueue_scripts','home_scripts' ); function home_scripts(){ If( is_shop() || is_product_category() || is_product() ){ wp_register_style( 'style-woocommerce', get_stylesheet_directory_uri().'/style-woocommerce.css' ); wp_enqueue_style(…
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 );…