Need a little help with this bookmarking code
-
Hi guys,
I found this really cool script that can be used to show a bookmark link on wordpress posts:
https://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>`
- The topic ‘Need a little help with this bookmarking code’ is closed to new replies.