• Resolved Vendetta

    (@vendetta)


    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?

Viewing 6 replies - 1 through 6 (of 6 total)
  • whooami

    (@whooami)

    for one thing, quote marks have to be escaped:

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

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

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

    whooami

    (@whooami)

    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.

    tamishka

    (@tamishka)

    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>
    <? } ?>

    Thread Starter Vendetta

    (@vendetta)

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

    vkaryl

    (@vkaryl)

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘hyperlinks in conditional tags’ is closed to new replies.