how to force tag page layout to use same as search layout?

You can tell WordPress to use the search.php template whenever viewing tags by using the template_include. It works like this: function wpse_240429() { // IF we’re planning on loading a tag template if( is_tag() ) { // Try to locate the search.php template $search_template = locate_template( ‘search.php’ ); // If the search template exists if( … Read more

Load sidebar template just once to prevent multiple animations

you can write the script with a conditions <?php is_front_page(){ ?> <script> jQuery(window).ready(function($){ $(“#sidebarRight”).animate({right: ‘0px’}); }); </script> <?php } ?> alternatively you can set the cookie or localstorage that the animation has been completed <script> if(!localStorage.getItem(“animated”)){ // check if the animated is set if not set do the animation jQuery(window).ready(function($){ jQuery(“#sidebarRight”).animate({right: ‘0px’}); localStorage.setItem(“animated”, “yes”); // … Read more

Display current category and child

$current_cat_id = get_queried_object_id(); $kids = get_terms([ ‘taxonomy’ => get_queried_object()->taxonomy, ‘parent’ => $current_cat_id, ]); <?php $terms = get_terms([ ‘taxonomy’ => get_queried_object()->taxonomy, ‘parent’ => get_queried_object_id(), ]); echo ‘<div style=”height: 200px; text-transform: uppercase; border:1px solid #666666; padding:10px; overflow-y: scroll;”> <ul> foreach ( $terms as $term) { echo ‘<li><a href=”‘ . get_term_link( $term ) . ‘”>’ . $term->name . … Read more