• I’m trying to use the conditional tags for my comments template. I have this

    <?php
    if (is_page()) {
    if (is_page('guestbook')) {
    echo "<h1 id='respond'>";
    echo ImageHeadline_render( 'Sign the guest book' );
    echo "</h1>";
    }
    if (is_page('144')) {
    echo "<h1 id='respond'>";
    echo ImageHeadline_render( 'Submit your site and comments' );
    echo "</h1>";
    } }
    else {
    echo "<h1 id='respond'>";
    echo ImageHeadline_render( 'Leave a reply' );
    echo "</h1>";
    }
    ?>

    The guestbook page turns out well, but for the page 144, the header render the ‘Submit your site and comments’ and also the ‘Leave a reply’, and for the rest of the pages, no title shows up at all. Is there anything wrong with my code?

    This template is used on my paged comments template.
    I wanted “Sign the guest book’ to shows up on the guestbook page, the ‘Submit your site and comments’ for page 144 and ‘Leave a reply’ for the rest of the pages.

    All help would be appreciated. Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • What is ImageHeadline_render?

    Thread Starter Truth

    (@truth)

    That is the code for the image headlines plugin.

    I think I fixed it, thanks ??

    Truth–please consider describing how you resolved the problem so that your fellow WordPress users can learn from your experience.

    Thanks.

    Thread Starter Truth

    (@truth)

    sure ??

    basically this is the working one

    <?php
    if (is_page()) {
    if (is_page('guestbook')) {
    echo "<h1 id='respond'>";
    echo ImageHeadline_render( 'Sign the guest book' );
    echo "</h1>";
    } elseif (is_page('144')) {
    echo "<h1 id='respond'>";
    echo ImageHeadline_render( 'Submit your site & feedbacks' );
    echo "</h1>";
    } else {
    echo "<h1 id='respond'>";
    echo ImageHeadline_render( 'Leave a reply' );
    echo "</h1>";
    }
    }
    ?>

    comparing the code, the second one should be elseif and not if =D

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Help need for using conditional tags’ is closed to new replies.