Last active
September 25, 2017 08:51
-
-
Save rashmimalpande/d80241803ab829305e58a455cbf69e29 to your computer and use it in GitHub Desktop.
This file contains 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
public function include_files() { | |
include_once('custom.html'); //path to your html file | |
} | |
public function add_custom_html() { | |
global $post; | |
$product_id = $post->ID; | |
$categories = get_the_terms( $product_id, 'product_cat' ); | |
if( empty ($categories)){ | |
return; | |
} | |
foreach($categories as $cat){ | |
if( 'men' == $cat->slug ) { | |
//include the html file here | |
$this->include_files(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment