Thursday, 11 June 2020

I want to remove shortcode from content [vc_row][vc_column][vc_column_text]

$content = get_the_content(); 
$content = preg_replace("~(?:\[/?)[^/\]]+/?\]~s", '', $content);
$content = wp_strip_all_tags($content);
echo $content; 

### OR ###

$content = get_the_content(); 
$content = do_shortcode($content);
echo $content;

Monday, 1 June 2020

How To Disable Automatic Updates in WordPress by Custom Plugin?


Using a simple plugin.

Did you know about automatic updates on the WordPress website?

Some time Some Core, Plugins, and Themes are auto-update in your live WordPress site.
That time you lose some custom changes and some other setting in your site.

How to prevent this type of loss and stop auto-update?
Let's follow these simple 4 steps:
1. Download the simple plugin WP Disable Automatic Updates
2. Upload in your WordPress site.
a. Go to in your Wordpress backend wp-admin menu > Plugins > Installed Plugins
b. Click on Plugin Add new button
c. Upload WP Disable Automatic Updates plugin (Not see any update list)
3. Active WP Disable Automatic Updates Plugin
4. Check-in Dashboard > Updates

Note: If you want to check any update in your WordPress site. You need to deactivate WP Disable Automatic Updates Plugin.










Monday, 18 May 2020

The best way to detect a mobile device



<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
var isMobile = false;
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
// some code write for mobile device...
isMobile = true;
}else{
isMobile = false;
}
</script>
</head>
<body>
<div>
<center><h1 id="device"></h1></center>
</div>
<script>
if(isMobile){
jQuery("#device").text("This is mobile device...");
}else{
jQuery("#device").text("This is not mobile device...");
}
</script>
</body>
</html>



Output:

This is...

Saturday, 1 February 2020

How to disable automatic updates in wordpress?



Write below code in current WordPress themes in function.php

/wp-content/themes/twentytwenty/functions.php
/* Disable Automatic Updates in WordPress */
function remove_core_updates(){
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_core','remove_core_updates');
add_filter('pre_site_transient_update_plugins','remove_core_updates');
add_filter('pre_site_transient_update_themes','remove_core_updates');
/* .Disable Automatic Updates in WordPress */

Wednesday, 1 January 2020

How do I redirect to another webpage by jQuery?


There are many ways you can do page redirect to another webpage by jQuery.

Here I give you two example:
  1. Page redirect to another webpage on document ready by jQuery.
    <script>
    // Page redirect on document document
    jQuery(document).document( function() {
        // Similar behavior as an HTTP redirect
          window.location.replace("https://phpkishan.blogspot.com");  //OR
          window.location = "https://phpkishan.blogspot.com";  //OR
          window.location.href = "https://phpkishan.blogspot.com";  //OR
          window.location.assign("https://phpkishan.blogspot.com");
    }
    </script>

  2. Page redirect to another webpage on button clicking by jQuery.

    <button id="buttonID">Page redirect</button>

    <script>
    // Page redirect on button clicking
    jQuery(document).document( function() {
        jQuery( "#buttonID" ).click(function() {
            window.location.href = "https://phpkishan.blogspot.com/";
        });
    }
    </script>