• Hello,

    when user searches my website, search.php lists both pages and posts (it’s quite good, of course), and shows “Comments” link for both pages and posts — and i’d like to get rid of this.

    I have tried to use smth like this:

    <?php if (is_post()) { comments_popup_link(
                             __('No Comments') .' »',
                            '1 ' . __('Comment') . ' »',
                             __('% Comments') . ' »'
                           ); } ?>

    But this failed, page stopped to display on this is_post.

    Then i’ve inserted if (function_exists('is_post')) { ... } and it looks like there is no such a function.

    Please help, what’s wrong?

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try using <?php if(!is_page())...

    Thread Starter dor

    (@dor)

    Thank you for your reply.

    Yes, i just have tried — no success.

    the_ID() displays correct IDs for every post/page, but this:

    <?php if (!is_page()) {
      comments_popup_link(
        __('No Comments') .' »',
        '1 ' . __('Comment') . ' »',
        __('% Comments') . ' »'
      ); }
    ?>

    … displays comments link for both posts and pages…

    🙁

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘2.8: Can not use is_page?..’ is closed to new replies.