Wednesday 28 December 2016

IF template name is this then do this in WordPress

Just add following code where you need.


if ( is_page_template('template_file_name.php') ) {
    // Returns true when 'template_file_name.php' is being used.
} else {
    // Returns false when 'template_file_name.php' is not being used.
}
?>

Ankit Shah PHP Expert

IT New Code suggest a solution for your problem related to coding, Specially .PHP, Wordpress, WooCommerce, Magento, HTML and CSS. Visit Our website for Information.

0 comments:

Post a Comment

 

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

Designed by: Ankit Shah