top of page

Creating Custom Single Product Page layout based on Different Category

  • Writer: سُلَيْمَان بْن دَاوُوْد
    سُلَيْمَان بْن دَاوُوْد
  • Nov 18, 2021
  • 1 min read


/*Custom Template Include*/
add_filter( 'template_include', 'victoria_template_include' );
function victoria_template_include( $template ) {
  /*Victorial Theatre Single Movie*/
  if ( is_singular('product') && (has_term( 'vic-theatre', 'product_cat')) ) {
    $template = get_stylesheet_directory() . '/woocommerce/single-product-victoria-film-theatre.php';
  } 

  /*Victorial Film Fest Single Movie*/
  if ( is_singular('product') && (has_term( 'film-festival-movies', 'product_cat')) ) {
    $template = get_stylesheet_directory() . '/woocommerce/single-product-victoria-film-festival.php';
  } 

  return $template;
}


 
 
 

Recent Posts

See All
Duplicate Category in Wordpress

The following code helps to duplicate the default wordpress category by help of code. // Add Duplicate option for categories in WordPress...

 
 
 
C#.NET and Its Associated Codes

1- Creating an Desktop Application in C#.NET C# ADO.NET & MySQL MAIN C# and MySQL ADO.NET with Crystals Reports Ready Code 2- Handling...

 
 
 

Comments


© 2020 by syednazrulhassan

bottom of page