Adding social bookmarking in the excerpt of the blog Homepage and categories

Discussion in 'WordPress' started by alishaceilava, Oct 16, 2012.

  1. #1
    Hello people,

    Here is the scenario.

    I am working on the following funny pictures blog. On the main page you will see the latest posts with full image size of the thumbnails. Now what I am trying to do is to install/insert the social bookmarking under-each image. Technically these are excerpts if I am not wrong.

    Now I had successfully did that once, by pasting the code from Addthis website (my profile) in to the 'index.php' and in the 'Category.php' . That do insert the social bookmarking, but when I click they don't work properly.

    What my understanding is that they are bookmarking the page rather the title of link of the exceprt.

    I did try installing the plugin for the excerpt, but they destroys my theme. Any suggestion or idea how can I do that.
    Appreciate
     
    alishaceilava, Oct 16, 2012 IP
  2. Devtard

    Devtard Notable Member

    Messages:
    850
    Likes Received:
    133
    Best Answers:
    4
    Trophy Points:
    220
    #2
    I do not know what kind of bookmarking links do you have in mind but I use something like this:

    http://twitter.com/home?status=Title http://example.com

    Installing plugins for simple things like this one is not recommended because they just slow down your site. Edit your file index.php (or single.php) and put the link there there where you want. You just have to replace "Title" and "http://%20example.com" with functions that print the current post title and URL.


    Functions for the loop in index.php:
    http://codex.wordpress.org/Function_Reference/the_title
    http://codex.wordpress.org/Function_Reference/the_permalink
     
    Last edited: Oct 16, 2012
    Devtard, Oct 16, 2012 IP
  3. alishaceilava

    alishaceilava Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Visit 925fun.com and on the homepage you will comet to know what I am talking about Thank you :)
     
    alishaceilava, Oct 16, 2012 IP
  4. steve0

    steve0 Member

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    as you're querying for posts within the loop - you'll need to craft the social links in relation to the post you're currently looping through. As mentioned above, look through the wordpress codex for the right code to use to output the current post url rather than the current page url, and then put that into your social links ;)
     
    steve0, Oct 17, 2012 IP
  5. alishaceilava

    alishaceilava Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    And it;s fixed... Thanks steve0 :D
     
    alishaceilava, Oct 20, 2012 IP