All posts in: WordPress PHP

Disable Jetpack

How to disable JetPack email notification of new posts to Subscribers?

14

Here is how to add a checkbox option to every new post of whether or not to email the post to Jetpack subscribers. Use the following code.

Handling Text file in PHP

109

After so long time, I was coding in PHP to write certain user inputs in a text file (.txt). Here are the codes that may find it helpful also. To check if text file is empty [crayon-5bc46cfc871bd046904980/]   To check if content already exists in text file [crayon-5bc46cfc871d6808590641/]   ..

Debug WordPress

150

WP_DEBUG is an useful debugging tool available in WordPress to see PHP errors on your website and they are helpful for developers to troubleshoot issues with the website. To turn on WP_DEBUG, add following code in wp-config.php define(‘WP_DEBUG’,true); It is not advisable from security point ..

PHP Isset() and Empty()

388

Empty() Returns False if empty() has non-empty and non-zero value. Returns True for Null, 0, “”   Isset() Returns False for Null Returns True for 0, “” or any value   Both Textareas and Texboxes will sent “” values and not Null to the $_POST[], so use Emtpty() ..

WordPress – Use javascript to print specific contents in page

332

  This solution worked for me. Step 1: Specify the printable contents inside this div. <a href=’javascript:printContent(“ad_div”)’ id=’print_link’>Print</a> <div id=’ad_div’> specify your printable content here… </div> ..

Add Javascript in WordPress Pages

289

WordPress defaults security feature restricts use of JavaScript into your content. However there are plenty of plugins out in WordPress that allows JavaScript within page or posts. After testing few, the most easy and workable plugin we found is Scripts n Styles. It provides awesome features like Blog ..

WordPress – How to pass variable as parameter in URL

928

  This simple method worked for my WordPress website to pass a parameter in URL. In this tutorial, the Datewise Invoices page lists down all the invoices created between the dates. When you click on a specific Invoice No, the invoice no is passed as parameter value and a new webpage opens ..

showing errors with wpdb update or insert query

643

exit(var_dump( $wpdb->last_query )) prints the last query that is executed by database. This is very useful for developers to verify and troubleshoot errors in your query syntax or data format. One sample is presented here for you. if ($wpdb->update(“laundry_item_master”, array( ..

wpdb last_query, last_result, last_error

853

There are times that you wanted to print the exact query itself or query result right after it is executed. Use following wpdb class variables to troubleshoot. $wpdb->last_query This prints that last query that is executed, I mean the exact MySQL Query itself. $laundrycustomer = $wpdb->get_row(“SELECT ..

Difference between wpdb get_row(), get_results(), get_var() and get_query()

1336

WordPress defines a class called wpdb, which contains a set of functions used to interact with a database. Its primary purpose is to provide an interface with the WordPress database, but can be used to communicate with any other appropriate database. The $wpdb object can talk to any number of tables, ..

Thank you for visiting us. To continue receiving updates, please Subscribe to our Social Media Channels.

Google+
FACEBOOK
RSS
YOUTUBE
Menu Title