Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Target specific product category page

Discussion in 'Misc WordPress Requests' started by anurag.deshmukh, Feb 28, 2018.

  1. anurag.deshmukh


    Reply To: Target specific product category page, by anurag.deshmukh

    You need to check with current taxonomy details (term id or term name).

    $taxonomy = get_queried_object();
    $current_tax = $taxonomy->term_id;

    Get your term details by term name based for custom taxonomy.
    $term = get_term_by('name', 'metal-idols', 'prod_tax'); // replace them with correct/appropriate values

    check if current taxonomy/category equals what we get in $term, then you can change dimensions for that product else go on with current dimensions.

    for example :

    if($current_tax == $term->term_id) {
    // These parameters will be for particular category/taxonomy
    $width = '';
    $height = '';
    } else {
    $width = '';
    $height = '';

    You can use dimensions or code in if else condition the way you need to use.

    Reply To: Target specific product category page

Share This Page

Monarch Social Sharing Plugin