adding woocommerce.php to functions.php forceTemplate function
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 27 Sep 2016 17:28:25 +0000 (13:28 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 27 Sep 2016 17:28:25 +0000 (13:28 -0400)
functions.php

index 6934766..d50bb3c 100644 (file)
@@ -156,15 +156,9 @@ add_action('thematic_searchloop', 'mytheme_search_loop');
 // START FORCE TEMPLATE FUNCTIONS
 add_filter( 'template_include', 'glm_force_template', 99 );
 function glm_force_template( $template ) {
-    global $post;
-    /*
-     *  Uncomment this IF statement surrounding the locate_template line
-     * if you want to use the given template (index.php) EVERY time any page
-     * template is selected & included.
-     */
-    //if (get_page_template_slug( $post->ID ) == "test-template") {
+    if ($template != locate_template("woocommerce.php")) {
         $template = locate_template( "index.php" );
-    //}
+    }
     return $template;
 }
 function get_custom_page_templates() {