[Plugin: SexyBookmarks] How-To: Using one SexyBookmark instance for your whole site
-
Hi there,
I am redesigning my elderly WP site and want to drop SexyBookmarks in the header.
Out of the box, SexyBookmarks is always tied to a post.
My goal is to let SexyBookmarks work for any URL of my site.
Here are my changes:
In
sexy_get_fetch_url()
, set `$perms = ‘https://’ . $_SERVER[‘SERVER_NAME’] . $_SERVER[‘REQUEST_URI’] . $_SERVER[‘QUERY_STRING’];
`In
get_sexy()
, set$title = urlencode(get_bloginfo('name') . wp_title('-', false));
In
get_sexy()
, set$perms = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . $_SERVER['QUERY_STRING'];
In
get_sexy()
, set$mail_subject = urlencode(get_bloginfo('name') . wp_title('-', false));
This solution has one caveat in respect to anchors. Since URL anchors do not get send to the server, PHP cannot possibly know about it. URLs like https://localhost/wordpress/856-pong/comment-page-1#comment-1022 cannot be shared by SexyBookmarks. They will look like https://localhost/wordpress/856-pong/comment-page-1 instead, without the anchor.
I can live with that ??
Summing it up, I call
selfserv_sexy()
twice: once in header and footer of every page served by WordPress. On each page users can share this very page.Comments & ideas greatly welcome ??
- The topic ‘[Plugin: SexyBookmarks] How-To: Using one SexyBookmark instance for your whole site’ is closed to new replies.