how to increase connection time

Maybe your hook called too early. And after yours, this connection time changes elsewhere. Try to increase priority like that: add_filter( ‘auth_cookie_expiration’, ‘keep_me_logged_in’, 99, 3); function keep_me_logged_in( $expiration, $user_id, $remember ) {/*your code*/}

I’m creating a online store for my website, my aim is to add description to products in home page only how can i achieve it?

You can use is_front_page() function in your code. add_action(‘woocommerce_after_shop_loop_item_title’, ‘description_in_shop_loop_item’, 3 ); function description_in_shop_loop_item() { global $product; if( is_front_page()) { // HERE define the number of words $limit = 10; $description = $product->get_description(); // Product description // or // $description = $product->get_short_description(); // Product short description // Limit the words length if (str_word_count($description, 0) > … Read more

Remove pagination if search returns empty

add this code in your search.php <?php $show_pagination = true; if($wp_query->post_count < 0) { $show_pagination = false; } ?> <?php if($show_pagination){ ?> <!– The pagination component –> <div class=”container”> <div class=”row mt-3″> <?php understrap_pagination(); ?> </div> </div> <?php } ?> So your search.php look like this : <div class=”wrapper” id=”search-wrapper”> <div class=”<?php echo esc_attr( $container … Read more

Add Product Permalink in woocommerce admin order page

There’s no permalink property of a product. Permalinks are not stored in the database, because they’re generated based on a number of external factors. Therefore you need to use a function to retrieve the permalink. In WooCommerce the best way to do this is with: function fpd_custom_order_item_values($_product) { $url = $_product->get_permalink(); echo ‘<p>’ . esc_url( … Read more

Extend WordPress Audio Widget to accept HLS (.m3u8) URLs

There is a filter, wp_audio_extensions, that should allow you to add m3u8 to the whitelist of allowed file extensions. Add this code to a child theme’s functions.php file, or using a plugin like Code Snippets: function wpse_341199_allow_m3u8_extension( $exts ) { $exts[] = ‘m3u8’; return $exts; } add_filter( ‘wp_audio_extensions’, ‘wpse_341199_allow_m3u8_extension’ );

Display current user metadata on WordPress page

You can try below snippet of code. i have develop shortcode you can take reference from it. function current_user_data_func( $atts ) { extract( shortcode_atts( array( ‘metakey’ => ”, ‘user_field’ => ”, ), $atts) ); ob_start(); if(is_user_logged_in()) { $current_user = wp_get_current_user(); $c_user_id = $current_user->ID; if(!empty($metakey)) { $value = get_user_meta( $c_user_id, $metakey, true); echo $value; } if(!empty($user_field)) … Read more