• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

template_include vs template_redirect

August 19, 2013 by Webhead

WordPress has a filter called ‘template_include’ and it also has an action called ‘template_redirect’.  The filter allows you to change what template file to use by returning a file path while the action is usually used to write whatever you need to and then exit.

According to this issue for bbPress template_redirect can cause incompatibility issues with other plugins using this hook.  Also using this hook exits WordPress abruptly not allowing WordPress to run through it’s normal procedure (according to one blog).  It is probably best to use ‘template_include’ unless you have a specific reason not to.

Filed Under: Coding Tagged With: optimize, wordpress

Primary Sidebar

Topics

apache apple block editor chrome cms css debug eCommerce embed firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery linux localization mac os x ms sql mysql open source optimize php php 5.3 responsive rest api seo svg tinymce woocommerce wordpress wpengine xss yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools