Forums

[Plugin: Sociable] share-buttons on front always lead to last post (3 posts)

  1. Schaaf
    Member
    Posted 2 years ago #

    hey guys!

    at first, sorry for my bad english but nevertheless, I'm going to try to explain my problem :)

    I'm a real wordpress noob. And I succesfully installed Sociable, it works and looks good. I also achieved to put it onto my frontpage or home directory (at the bottom of the page, exactly where I want it to be) but here's the problem:

    if you press, for example share on facebook, it always wants to share the newest post. But I would like to share the whole blog, if you know what I mean. It works perfect with all the entries but not with the frontpage.

    Is it generally possible to get Sociable to share the whole blog, the front page, if its placed there? or is it only able to share single entries/posts?

    I hope you understand what I mean. Please take a look at it: http://www.fotoflut.at

    thanks!

  2. elliec
    Member
    Posted 2 years ago #

    Hi!

    I had the same problem. I'm not a php or wp expert, but I think it's related to using get_permalink() in the sociable code, to extract the url.
    See this page:
    http://core.trac.wordpress.org/ticket/9963

    I found some more information on getting the page url here:
    http://www.webcheatsheet.com/PHP/get_current_page_url.php
    and here:
    http://www.bradino.com/php/get-current-url/
    http://whn.vdhri.net/2005/11/how_to_find_the_current_url_with_php.html

    Also the variable $title wants to have the post title, not the page title.

    But unfortunately, I have no ready fix. Anyone else?

    Thanks
    /E

  3. elliec
    Member
    Posted 2 years ago #

    Hi again,

    I got this to work: in sociable.php I replaced the lines

    $permalink 	= urlencode(get_permalink($post->ID));
    $title 		= str_replace('+','%20',urlencode($post->post_title));

    with

    $permalink 	= urlencode("http://" . $_SERVER['HTTP_HOST'] .  $_SERVER['REQUEST_URI']);
    $title 		= str_replace('+','%20',urlencode(wp_title('', false, ’right’)));

    /E

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags