Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

jesseslam on "Using conditional tags in a child theme functions.php file"

$
0
0

Hi,

My client's website is using Jigoshop and I need to add some conditional code to the functions.php file to show a link to a size chart only in certain category IDs just above the add to cart button. I've copied the code needed into my child theme's functions.php file as seen below but for some reason the div just won't show for these categories. I've tested the same code using the is_single tag and it works fine but just can't get it working with category IDs, any help would be appreciated please?

<?php if ( in_category( array( 50,19,18 ) ) ) {
echo '<div class="size-chart">Hello</div>';
} ?>

Many thanks,

Jim Isles


Viewing all articles
Browse latest Browse all 8245

Trending Articles