WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Links not opening correctly (5 posts)

  1. scottbrown
    Member
    Posted 4 years ago #

    Hi there,

    I have added some social bookmarking links to my site in the single post (single.php) file - they won't open in the correct format, it adds my site address at the start of the link.

    the link in the single.php is -
    http://twitter.com/home/?status=<?php echo urlencode(the_title(”,”, false)) ?>:<?php the_permalink() ?>

    when clicked opens as -
    http://test.scottbrown.co.nz/"http://twitter.com/home/?status=”New+Test”:http://test.scottbrown.co.nz/?p=34"

    any ideas?

  2. Spencer Finnell
    Member
    Posted 4 years ago #

    What code did you use to add these links?

  3. scottbrown
    Member
    Posted 4 years ago #

    complete code for this link is as follows:

    <a href=”http://twitter.com/home/?status=<?php echo urlencode(the_title(”,”, false)) ?>:<?php the_permalink() ?>” target=”_blank”><img src="images/twitter.png" width="19" height="19" border="0" alt="" /></a>

  4. Spencer Finnell
    Member
    Posted 4 years ago #

    You need to replace your 'curly quotes' with just normal quotation marks.

    <a href="http://twitter.com/home/?status=<?php echo urlencode(the_title(",", false)) ?>:<?php the_permalink() ?>" target="_blank"><img src="images/twitter.png" width="19" height="19" border="0" alt="" /></a>

    Should work.

  5. scottbrown
    Member
    Posted 4 years ago #

    Thanks Spencer, I knew it would be something simple... been staring at the page for too long :)

Topic Closed

This topic has been closed to new replies.

About this Topic