WordPress.org

Ready to get started?Download WordPress

Forums

Sociable plugin: only on front page link (3 posts)

  1. Doodlebug
    Member
    Posted 6 years ago #

    Hi,
    I'm using the Sociable plugin (http://yoast.com/wordpress/sociable/) on my site at http://doodlebug.josephlavington.com.

    I only want it on the front page (not on posts), which I currently have implemented using the PHP snippet in my sidebar:

    <?php if (function_exists('sociable_html')) {
      echo sociable_html();
    } ?>

    However the link it gives is the second from latest entry. Partly I think this is because i'm using multiple loops and something is wrong (i'm trying to fix it).

    But I don't want it to be a link to a post (latest or not) anyway, but to the actual main blog URL - or is this not something it can do?

  2. dhvrm
    Member
    Posted 6 years ago #

    1. Open sociable.php in wp-content/plugins/sociable
    2. Find the line, somewhere around line 673, that reads: $permalink = urlencode(get_permalink($post->ID));
    3. Change that line to read: $permalink = urlencode(get_option('siteurl'));

    All your links will now be to the base URL of your blog.

  3. dhvrm
    Member
    Posted 6 years ago #

    Note, however, that linking your bookmarks to your blog's base URL will likely cause your bookmarks to be rejected by many providers (such as Digg) or reported by other users.

Topic Closed

This topic has been closed to new replies.

About this Topic