• I’m stuck! Would you help me? I need a PHP query:

    – If no subtitle is entered, the category name(s) should be displayed.

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author HasanulBanna

    (@hasanulbanna)

    Hi iwd82,
    Please try following code and let me know is it work ??

    <?php if (function_exists('the_subtitle')
    ){
    the_subtitle();
     }else { ?>
    single_cat_title();
    <?php }?

    ~Ben

    Thread Starter Jonathan

    (@iwd82)

    Thanks for your reply Ben!

    Unfortunately, your suggestion does not work. I think it may not work, because the query is based on the activated function. After the plugin was enabled, no category will be displayed, because the subtitle is functionally exist.

    What do you think about this:

    <?php
    if($page_sub_title) {
    echo $page_sub_title = get_post_meta($post->ID, 'page_sub_title', true);
    }
    else {
    echo $category = the_category(', ');
    }
    ?>

    I guess that could work.
    Jonathan

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need a PHP query! If no subtitle is entered, the category name(s) should be disp’ is closed to new replies.