Created
February 10, 2017 09:30
-
-
Save vovadocent/13a33789c84c1e12c313bf9b97ed073b to your computer and use it in GitHub Desktop.
woo product page template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('template_include', 'portfolio_page_template', 99); | |
function portfolio_page_template($template) { | |
global $post; | |
if (!is_archive() && $post->post_type == 'product') { | |
$tpl = get_field('template_name', $post->ID); | |
if ($tpl) { | |
$new_template = locate_template(array($tpl)); | |
return $new_template; | |
} | |
} | |
return $template; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment