WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Need a little help with this bookmarking code (3 posts)

  1. TransPersonal
    Member
    Posted 4 years ago #

    Hi guys,

    I found this really cool script that can be used to show a bookmark link on wordpress posts:

    http://www.ampercent.com/add-bookmark-page-wordpress-blog/1552/

    The code works except it shows

    <?php the_title(); ?>

    in the default "name" field instead of the actual post title. Does anyone know how this can be solved?

    The javascript code:

    /********** BOOKMARK SCRIPT STARTS **********/
    function bookmarksite(title,url)
    { if (window.sidebar) // firefox
    window.sidebar.addPanel(title, url, "");
    else if(window.opera && window.print){ // opera
    var elem = document.createElement('a');
    elem.setAttribute('href',url);
    elem.setAttribute('title',title);
    elem.setAttribute('rel','sidebar');
    elem.click(); }
    else if(document.all)// ie
    external.AddFavorite(location.href, document.title) }
    /********** BOOKMARK SCRIPT ENDS **********/

    Template code:

    `<div class="bookmark">
    <!--[if IE]>
    " onclick="return external.AddFavorite(location.href, document.title)">Add to My Favorites!
    <![endif]-->
    <![if !IE]>
    ', '<?php the_permalink(); ?>')">Bookmark this Page
    <![endif]>
    </div>`

  2. TransPersonal
    Member
    Posted 4 years ago #

    Never mind, I found a different script that works. Resolved.

  3. fuzzie
    Member
    Posted 4 years ago #

    Which one did you find?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.