Support » Plugin: Categories Images » How do you write an if function does not exist for this plugin?

  • Resolved davidjs


    I have a default header image and Im trying to write a function that will check if z_taxonomy_image_url has a value in it, if not my default header will display. I also have to check if header_top exist.
    I tried
    <?php if ( ! get_field(‘header_top’) && !function_exists(‘z_taxonomy_image_url’) ) {

    It seams that the function always exist so my default header never shows, so I need a function that not only checks if the function exist but if its blank. So my default header code will show when header_top and taxonomy image are blank.

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


    You simply need to store the returned value of the function in a variable and then check if this variable are empty or not, for example:

    $cat_img_url= z_taxonomy_image_url();
    if (!empty($cat_img_url))
     // display your category image here
     // display your header image here

    try it and tell me if you still need help.


Viewing 1 replies (of 1 total)
  • The topic ‘How do you write an if function does not exist for this plugin?’ is closed to new replies.