putting Mailto: and Tel: into footer.php code wordpress

Please edit your code as below: <address class=”address_phone”> <span class=”icon icon-phone”></span> <div class=”contact_title”><?php echo esc_html__(‘Phone:’, ‘yogastudio’) ?></div> <span class=”contact_item phone”> <?php if (!empty($phone)) { echo ‘<a href=”https://wordpress.stackexchange.com/questions/346269/tel:”.$phone.'”>’.esc_html($phone).'</a>’;} ?> </span> </address></div><div class=”column-1_3″> <address class=”address_email”> <span class=”icon icon-mail”></span> <div class=”contact_title”><?php echo esc_html__(‘Email:’, ‘yogastudio’) ?></div> <span class=”contact_item mail”><?php if (!empty($email)) { echo ‘<a href=”https://wordpress.stackexchange.com/questions/346269/mailto:”.$email.'”>’.esc_html($email).'</a>’;}?></span> </address></div>

Cannot add javascript to footer

Your’re missing the call to wp_enqueue_script( ‘search’ ); after it’s registered. function js_enqueue_search() { wp_register_script( ‘search’, get_stylesheet_directory_uri() . ‘/js/search.js’, ”, wp_get_theme()->get( ‘Version’ ), true ); wp_enqueue_script( ‘search’ ); wp_localize_script(‘search’, ‘search_ajax’, array( ‘ajaxurl’ =>admin_url( ‘admin-ajax.php’ ))); } add_action( ‘wp_enqueue_scripts’, ‘js_enqueue_search’ );

WP nonce invalid

Found out what the problem was. Polylang plugin verifies the nonces, so you need to pass it the ‘new-post-translation’ arg. The solution is: wp_nonce_url( $link, ‘new-post-translation’ ); it might help someone, but maybe no 😉

Query all posts of a custom taxonomy term

I believe your issue is with understanding the nature of posts’ hierarchy vs pages’ hierarchy. A page is a type of “post”. It can have hierarchical structure. Posts, by default, do not have hierarchy. So, you would not be able to get post-parents without their children, because the system does not recognize a hierarchy. This … Read more

WooCommerce – Reset quantity input field when variation changes

To reset quantity input field to 1 when variation changes on product detail page use below code. you can set default quantity from jQuery(“[name=”quantity”]”).val(1);. i have tested and it is working fine for me. add_action( ‘wp_footer’, ‘variation_change_update_qty’ ); function variation_change_update_qty() { if (is_product()) { ?> <script> jQuery(function($){ $( “.variations_form” ).on( “woocommerce_variation_select_change”, function () { jQuery(“[name=”quantity”]”).val(1); … Read more

combine Code 1 with Code 2

Modified PHP code <?php // First, define these. $max_cat_count = 32; // this is ‘x’ $qty_per_column = 8; // this is ‘y’ // Then the $args array. $args = array( ‘taxonomy’ => ‘product_cat’, ‘number’ => $max_cat_count + 1, // keep the + 1 ‘hide_empty’ => 0, // … your other args here … ); // … Read more

Show comments menu in dashboard only if the site has comment

Okay, the solution is this below to hide Comments menu if the site doesn’t have any comments (approved, pending, trash or spam). function remove_commentsmenu() { global $user_ID; if ( 1 > wp_count_comments( get_the_ID() )->total_comments && 1 > wp_count_comments( get_the_ID() )->trash ) { remove_menu_page( ‘edit-comments.php’ ); } } add_action( ‘admin_menu’, ‘remove_commentsmenu’ );