Woocommerce getting top level category parent and make all sub categories have the same template and menu

WP native function get_queried_object() can help you to get an ID of a currently displayed term. WooCommerce then includes this handy function: woocommerce_get_term_top_most_parent() (originated here on WPSE btw,) that will get it’s top-level parent term. I haven’t tested the following code but it should provide a good starting point: if ( ‘wedgwood’ == woocommerce_get_term_top_most_parent( get_queried_object()->term_id … Read more

Disable CSS for IE 8 and earlier.

Deregister twentytwelve-ie, which is registered (currently) in function.php on line 157. function dereg_ie_styles_wpse_99631() { wp_deregister_style(‘twentytwelve-ie’); } add_action( ‘wp_enqueue_scripts’, ‘dereg_ie_styles_wpse_99631′, 1000); That isn’t just IE8 though. It is registered as less than or equal to IE 9. If you want to remove all of the stylesheets for IE8 or less you are in for a bumpy … Read more

If tag exists, then echo once

I’m not sure what you want, but if you are trying to get a unique <li>-list from the query you can try (untested): <?php // LOOP ARGUMENTS $args = array( ‘post_type’ => ‘xyz_members’, ‘posts_per_page’ => -1, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘tax_query’ => array(array(‘taxonomy’ => ‘member_types’,’field’ => ‘slug’,’terms’ => ‘current-class’,’operator’ => ‘NOT IN’))); $loop … Read more

If custom taxonomy else conditional [closed]

For custom post types use is_post_type_archive(‘tips’). Let us know if this works. It should also work with an array is_post_type_archive( array( ‘tips’, ‘cpt’, ‘another cpt’ ) ) I am currently using this function to recognize specific post type archives. See: A Post Type Archive in codex. It would be best if you could specify which … Read more

conditional: if is page, and all subpages

Use get_ancestors to get the page parent, then check against that value instead of checking against the name. $ancestors = array(); $ancestors = get_ancestors($post->ID,’page’); $parent = (!empty($ancestors)) ? array_pop($ancestors) : $post->ID; if (!empty($parent)) { switch ($parent){ case 1 : // menu for parent page ID 1 break; case 2 : // menu for parent page … Read more

Variable Not Working Inside is_author() Array

You’ve converted $taxonomy_id_list to a comma separated string then shoved that string into an array. Your array now looks like array( “1,2,3,4” ); That is not going to match any author ID. You are misunderstanding what implode does. This–1,2,3,4,5,6,7— is a set of integers. If place in the array like this– array(1,2,3,4,5,6,7)— you get an … Read more

If is_single in functions.php

Generally it’s not a common way to strip wpautop with remove_filter as it is native functionality of WordPress. But if you want to : place the remove_filter() function right before the the_content() function on the pages/templates where you don’t need the wpautop <?php remove_filter( ‘the_content’, ‘wpautop’ ); the_content();?>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)