Support » Plugin: Categories Images » Image category with external link (_blank)

  • Resolved moisb


    Hi, how to add external link for this image? Example: in my template i put this: <a href="<?php echo get_category_link($cat->term_id); ?>"><img src="<?php if (function_exists('z_taxonomy_image_url')) echo z_taxonomy_image_url(); ?>" alt="<?php single_cat_title('Cupons desconto '); ?>" /></a>
    But on <a href="<?php echo get_category_link($cat->term_id); ?>"> link to category, I want this category image link to external link. Example: category image “Best Buy” link’s to “”. How?

Viewing 1 replies (of 1 total)
  • Plugin Author Muhammad


    Simply don’t use get_category_link() function and put your external link instead 🙂
    And if you where in loop and want one of these categories to open an external link just check using a php code, for example:
    <a href="<?php if($cat->term_id == 1) echo ""; else echo echo get_category_link($cat->term_id); ?>" >
    As “1” is the id of the category that you want it to to open the external link.

    Thanks and hope I helped.

Viewing 1 replies (of 1 total)
  • The topic ‘Image category with external link (_blank)’ is closed to new replies.