WordPress – Image href for home menu nav not working

The class used for your navigation menu’s anchor tag has a css selector :hover. Because the image logo has been added withing the anchor tag, it is considered a part of the link and the hover styling affects it as if it were any other link in your nav menu. Solutions Find another way to … Read more

Two loops in one function

There’s no need to set up a new query, just use the first one. Replace: $loop = new WP_Query( $args2 ); while ( $loop->have_posts() ) { $loop->the_post(); …with: $firstloop->rewind_posts(); while ( $firstloop->have_posts() ) { $firstloop->the_post(); Update: Missed a few other bugs in your code, here’s the complete rework: function new_function() { $args = array( ‘post_type’ … Read more

Include a php file that is above WP installation hierarchically?

OK. I’m assuming you have WordPress setup as a sub-directory of your root URL. If so, this should work: <?php include ‘http://www.site.com/file.php’; ?> Sometimes people write the include special form with parentheses. In most cases it won’t break anything, but if your code looks like this, try removing them: <?php include(‘http://www.site.com/file.php’); ?> Also, make sure … Read more

Need some help with tweaking a code for woocommerce [closed]

try this $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); // current term $parent_slug = ”; // default slug param if( $term->parent ){ // if current term has parent then get it’s slug $parent = get_term( $term->parent, get_query_var(‘taxonomy’) ); // term’s parent $parent_slug = $parent->slug; // slug of parent term } // … Read more