dimanche 27 décembre 2015

If Else statement in Wocommerce template page

I'm trying to write an if else statement for a Woocommerce template page that does this:

if category is not a subcategory then:

do_action( 'woocommerce_before_subcategory_title', $category );

else show this:

<h3>
    <?php
        echo $category->name;

        if ( $category->count > 0 )
            echo apply_filters( 'woocommerce_subcategory_count_html', ' <mark class="count">(' . $category->count . ')</mark>', $category );
    ?>
</h3>

So far I have a very primitive function that is no where near what the end product will be.

Your help is greatly appreciated!

Aucun commentaire:

Enregistrer un commentaire