WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to add social icons in front of every post on index.php? (4 posts)

  1. amrikvirdi
    Member
    Posted 2 years ago #

    here my index.php code: http://pastebin.com/VY6zRWRQ

    Here is my social sharing code which I got from ShareThis.com: http://pastebin.com/r6QVqa7a

    Please help me with the code. Im will just replace my index.php code with your modified code.

    Site: explorefeed[.].com

  2. Digital Raindrops
    Member
    Posted 2 years ago #

    I would say that adding this code on a listing page will not do what you want as it shares the listing page and not the posts in the loop, something like the buttons on this page footer, these only share the website.

    This code would go in single.php and or page.php, I would not add this to the loop, as having share button script in post lists can impact on the loading time for your list pages, because it has to get the button script from the share website for each post, this is the same for Facebook, Google and Twitter buttons.

    Some of the script code in your pastebin would go into header.php and not the page files.

    I would suggest just using a plugin like sexybookmarks just on posts, you can select which buttons, and before or after content.

    HTH

    David

  3. amrikvirdi
    Member
    Posted 2 years ago #

    I will use that plugin in the inner post. But for now I want to add social icons in front of every post on homepage. So What I do for it?

  4. Digital Raindrops
    Member
    Posted 2 years ago #

    That plugin can do that, but as I said adding share buttons to lists will slow down your page load times, looks desperate and messy as well!

    How many website do visitors see a post and "share" apart from a few trolls to get traffic to thier own twitter or facebook?

    David

Topic Closed

This topic has been closed to new replies.

About this Topic