Forums

[resolved] hyperlinks in conditional tags (7 posts)

  1. Vendetta
    Member
    Posted 3 years ago #

    I've created conditional tags for my sidebar so that it only displays certain information for certain pages. That works fine. So, if I follow a:

    if (is_page('contact')) {

    with

    echo "Click Me";

    It displays fine. But if instead follow with:

    echo "<a href="???">Click Me</a>";

    I break my site. What am I doing wrong?

  2. whooami
    Member
    Posted 3 years ago #

    for one thing, quote marks have to be escaped:

    echo "<a href=\"???\">Click Me</a>";

  3. Otto42
    Moderator
    Posted 3 years ago #

    Only when inside similar quote marks. The way I prefer to do it:
    echo '<a href="???">Click Me</a>';

  4. whooami
    Member
    Posted 3 years ago #

    I would have suggested that but figured it was easier to just explain why what he was using wasnt working, in the event he uses a similar method again. Rather than suggesting a "new" way.

    Either one works, Vendetta, just remember that nested quotes ("" blah "") need to be escaped, if you opt for that method.

  5. Tamishka
    Member
    Posted 3 years ago #

    Could someone help me please! I am having a problem with my iframes
    1. when I fill out my forms and hit the submit button, the page returns to the original "iframe.index'' page without the "'thank you for filling out this form messege"'
    2. I am not receiving my replys to the forms via email

    could someone please help me.

    my code reads like this:

    ?>
    <br>
    <span class="style5">Vielen Dank für Ihre Nachricht.</span><br>
    <? }else{
    // if page runs 1st time
    ?><?php /*?><?php */?>
    <input name="Go" type="hidden" value="1" >
    <br>
    <table class="no_class" border="0" cellspacing="0" cellpadding="0">
    </form>
    <? } ?>

  6. Vendetta
    Member
    Posted 3 years ago #

    Hey, awesome people! I'm still learning here, so thanks for the help!

  7. vkaryl
    Member
    Posted 3 years ago #

    Tamishka: your issue is totally different from the OP's - please start your own thread on it. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic