Selectively exclude pages from being cached in W3 Total Cache

Selectively exclude pages from being cached in W3 Total Cache

You may want to exclude some dynamic pages from being cached in W3 Total cache. To exclude a particular page from caching, W3 Total cache just needs below line of code on that page before the html  start tag [crayon-59c10327e192a303637297/] For this code to appear on such pages all you need to do is to create some custom field e.g. nocache Just add this custom field to the post/page you want to exclude from caching and set the value to 1 In your header.php add below lines above the html tag [crayon-59c10327e1933163799620/] Other w3total cache options Disable database caching => DONOTCACHEDB Disable minify => DONOTMINIFY Disable CDN (Content Delivery Network) => DONOTCDN Disable Object Caching => DONOTCACHCEOBJECT ...
Read More

Points to consider before installing a new wordpress plugin

Installing a new plugin is very easy in wordpress. All you need to do is to search for your plugin, select it, install and activate. If you do not find it suitable to your needs, just deactivate, delete it and move on. However not many people realise what a plugin does in the background once it gets activated and assume that once a plugin is deleted its all gone which is really not true in most cases. A deleted plugin mostly leaves quite a few traces in your system. Depending upon the plugin these traces can severely affect the performance of your system if you try too many plugins without checking what it does in the background Many plugin developers do not follow WordPress coding standards. They do not provide an unintall function for the plugin. This means you need to manually clean up all the traces of the plugin after it is deactivated and deleted. I am currently not experiencing any performance issue with...
Read More
WordPress Hooks, filters and actions

WordPress Hooks, filters and actions

What are wordpress Hooks Wordpress Hooks provide the ability to enhance, modify or customise a wordpress functionality by writing your own code without modifying the wordpress core code. A Wordpress Hook code can either be written directly in your themes (preferably child theme's) functions.php or by creating your own plugin (recommended way) Types of hooks There are 2 types of wordpress hooks action hooks: These hooks can also be called as trigger hooks as they gets triggered based on a certain action/event. e.g. when a user registers on your site an action hook can be set up to geocode the user address and add the latitude longitude to the user_meta table. filter hooks: This hook allows to enhance or modify wordpress functionality or data e.g. it allows to use a custom template for certain post types, allows to use your custom page for lost password functionality, filter user data before displaying on browser or storing in the database. Examples of hooks user_register action hook: This action hook allows you to access data...
Read More

Difference between wp_print_scripts, wp_enqueue_scripts and wp_register_scripts

I had lot of confusion earlier while enqueuing or dequeuing a script in wordpress. I was not sure which function to use and would just keep on using various functions on a trail and error basis. Hope below points would help to clarify atleast a few things with regards to when we should use a particular function wp_register_scripts This just registers the script but does not actually queue it for execution wp_enqueue_scripts This is used to enqueue a script which is required to be executed on our template. A script can be enqueued without registering it i.e. without using wp_register_scripts. wp_print_scripts This is an action which prints/outputs/shows up the scripts on our template for execution When to use wp_register_script You may be wondering why would I use wp_register_scripts and why not just directly use wp_enqueue_scripts The answer to that is if you are developing a custom plugin and wish to execute a script only on certain pages then it helps to just register the script and then programatically enqueue it on the required pages.  ...
Read More