• Resolved Jackie Chan

    (@jackie-chan)


    Hi,

    Is it possible to set up custom page templates for product categories? For example:

    By default my products use single-product.php as the template and i’ve made a change to the “short-description.php” however for my category “Category B” i’d like to use a different “short-description.php” file. Is this possible?

    I’ve tried creating short-description-category-b.php and a few other ways but had no luck could you point me in the right direction?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you haven’t already figured out a solution, I think the way I would do it would be to in the single-product.php file use the has_term() function. e.g.

    if ( is_product() && has_term( ‘category’ ) ):
    // use this
    else
    // use this
    endif;

    Hope this helps.

    Linda

    (@lindamork)

    Automattic Happiness Engineer

    Hi there,

    I’m going to close this ticket since we haven’t heard back from you in a while.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to create multiple templates?’ is closed to new replies.