Wednesday, 20 April 2022

How to Removing product _ product-category _ or shop from the URLs in WordPress, WooCommerce?

Here, Removing /product/, /product-category/, or /shop/ from the URLs is not advisable due to the way WordPress resolves its URLs. It uses the product-category (or any other text for that matter) base of an URL to detect that it is an URL leading to a product category. There...

On logged in user can view WP site? How to Make Member only site?

Add following code in theme "functions.php"  file /*************************************************************************************************************  * Only logged in user can view site except Login, Register, Password-Recovery & successful Registration pages  *************************************************************************************************************/ add_action( 'wp', 'members_only' ); function members_only() {     // Restrict unlogged user     if( !is_user_logged_in() ) {        ...

How to Disable copy & Paste on website?

Just put following code in Header section <head> tag. <!----- Put this code in "<head>" tag   ------> <script type="text/javascript" language="javascript">      $(function() {             $(this).bind("contextmenu", function(e) {                 e.preventDefault();          ...

How to Disable Right click on website?

Just put following code in Header section <head> tag. <!----- Put this code in "<head>" tag   ------> <script language="javascript">                    var message="This function is not allowed here.";                    function clickIE4(){  ...

How to create a map based on Latitude & Longitude?

Sometimes we need a map based on specified location or dynamically create a map. Then we need to use Latitude & Longitude. Latitude & Longitude provide the perfect location of any place. By finding that we can create a map using it. Below Gives full code of Creation...

How to generate random number?

Using following code we can create random number. Than can be use Order number, unique id or like something that. <?php //Unique or Random number Generate //$today = date("Ymd"); $today = date("dmY"); $random = strtoupper(substr(uniqid(sha1(time())),0,6)); echo $order_no = $today . $random; ?> For more Interesting, Useful Article &...

How to get IP Address of System?

Run following PHP code for get IP Address. <html> <head>  <title>What is my IP address?</title> </head> <body> <?php   $ipaddress = '';     if ($_SERVER['HTTP_CLIENT_IP']){         echo "1-Ip is:".$ipaddress = $_SERVER['HTTP_CLIENT_IP'];    }     else if($_SERVER['HTTP_X_FORWARDED_FOR']){         echo "2-Ip is:".$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; }     else if($_SERVER['HTTP_X_FORWARDED']){         echo "3-Ip is:".$ipaddress = $_SERVER['HTTP_X_FORWARDED']; }     else if($_SERVER['HTTP_FORWARDED_FOR']){         echo...

 

Copyright @ 2016 IT New Code | Developing Code | Designing Code.

Designed by: Templateism