Posts

Remove Script and Stylesheet Version in Wordpress

Paste below code in the active themes function.php function remove_wp_version (   $src   )   {         if ( strpos ( $src , 'ver=' . get_bloginfo ( 'version' ) ) ) $src = remove_query_arg ( 'ver' , $src ); return $src ; } add_filter( 'script_loader_src', 'remove_wp_version', 9999 ); add_filter( 'style_loader_src', ' remove_wp_version ', 9999 );

Remove paypal checkout on product page in Prestshop

You need to follow these steps to fix it: 1. Login into PrestaShop admin panel 2. Click to Position under Module and Services tab 3. Scroll to  displayFooterProduct and unhook it. That's it. Enjoy...

Get YouTube video information using api in php

Follow below steps to get YouTube video information Step 1: create API key to authenticate with YouTube  Login to google developer account https://console.developers.google.com Step 2:  Create / Select project  Create new key or Get API key Step 3: Create a php script to get video details using YouTube video id         Example:         https://www.youtube.com/watch?v= ZdP0KM49IVk         in this url video id is showing in Red color Step 4: Add below code to your php file <?php $vdata = file_get_contents("https://www.googleapis.com/youtube/v3/videos?id=VIDEO_ID&key=YOUR_APIKEY&part=snippet,contentDetails,statistics,status"); $result_data = json_decode($vdata, true); echo "<pre>"; print_r($result_data); ?>

Select every other row as male/female from mysql table

To Get the result from 'users' table as below  +-----+--------+-------+ | row | gender | name | +-----+--------+-------+ | 1 | female | Lisa | | 2 | male | Greg | | 3 | female | Mary | | 4 | male | John | | 5 | female | Jenny | +-----+--------+-------+ Follow the below query SELECT * FROM ( SELECT users .*, IF ( gender = 0 , @ mr :=@ mr +1 , @ fr :=@ fr +1 ) AS rank FROM users , ( SELECT @ mr := 0 , @ fr := 0 ) initvars ) tmp ORDER BY rank ASC , gender ASC ;

Disable plugin update notification in wordpress

Add below code on your current theme's functions.php and add plugin base file name under unset . add_filter( 'site_transient_update_plugins', 'remove_wp_update_notifications' ); function remove_wp_update_notifications( $value ){ if ( isset( $value ) && is_object( $value ) ){ unset( $value->response[ 'hello.php' ] ); unset( $value->response[ 'js_composer/js_composer.php' ] ); } return $value; }

Featured image option not displaying in wordpress admin panel

When you are developing a fresh wordpress theme then you need Add this code to the themes functions.php : add_theme_support ( 'post-thumbnails' );

Redirect page using jQuery

You can use following methods to redirect a page using jQuery window.location.replace("http://www.keredari.com"); window.location.href = "http:// www.keredari .com"; $(location).attr('href', 'http://www.keredari.com'); $(window).attr("location","http://www.keredari.com");