Forums

default image for ShareThis on Facebook (8 posts)

  1. iechefs
    Member
    Posted 5 months ago #

    I have about four images across two side bars. When I click the ShareThis button to Facebook, how do I control which image it selects by default?

    Thanks.

  2. ChristiNi
    Member
    Posted 5 months ago #

    Hi iechefs,

    You should be able to control that with Facebook Open Graph Meta information.

    You can insert code into your functions.php file:

    http://www.wpbeginner.com/wp-themes/how-to-add-facebook-open-graph-meta-data-in-wordpress-themes/

    Or you can install a plugin to do add that functionality for you:

    http://wordpress.org/extend/plugins/facebook-open-graph-meta-in-wordpress/

    Hope this helps!

  3. iechefs
    Member
    Posted 5 months ago #

    /extend/plugins/facebook-open-graph-meta-in-wordpress/ broke the ShareThis plug in. I'll try the other link.

    Thanks

  4. iechefs
    Member
    Posted 5 months ago #

    So I tried the other link and pasted the following into my /wp-includes/functions.php file:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    It crashed the program. So I commented it out. Now it is working again, but it still loads the wrong image.

    By the way, I pasted it after the "<?php" and before the "?>" and not within any other function or procedure.

    The website is located at http://www.iechefs.org

  5. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

    Never, ever, edit core WordPress files like that! You should be editing your current theme's functions.php file.

  6. iechefs
    Member
    Posted 5 months ago #

    There isn't a functions.php in the theme--at least I didn't find it. I commented it out, but I can remove it complete. Do some themes have a different file name equivalent to functions.php?

  7. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

    No - Graphene will have a functions.php file.

  8. ChristiNi
    Member
    Posted 5 months ago #

    Hi iechefs,

    You should be able to view your theme's functions.php file in the Editor in your WordPress dashboard. It will have a title above the filename that says Theme Functions.

    Hope this helps!

Reply

You must log in to post.

About this Topic