Add Link to Facebook
Image Path from custom Field (3 posts)

  1. akedv
    Posted 3 years ago #


    my pictures are not attached to the posts, but the path is stored in a custom field named "image". how can these images be used for posting on facebook?

    and is there a way to deactivate displaying text from the post completely? my posts are just a shortcode which doesn't get "translated" no matter which option is de-/activated, so i just want to switch off posting the post text to fb at all.



  2. M66B
    Posted 3 years ago #

    Somewhere in forum mentioned below is an example how to use custom field values as image URLs.

    Almost anything can be accomplished by a little programming using the filters and hooks Add Link to Facebook provides, but either you have to do this yourself or find someone who can do this for you.

    For your next support question or follow up on this question, please go here: http://forum.faircode.eu/

  3. akedv
    Posted 3 years ago #

    great thx, i found the answer here:


    just a quick howto for those with a similar problem:

    add the following code to your functions.php (or use a plugin like "Make it Yours" and add it to the custom functions), be shure to enter the right value for "YOUR-CUSTOM-FIELD-NAME-HERE"

    'add_filter('al2fb_picture', 'al2fb_custom_picture', 10, 2);
    function al2fb_custom_picture($picture, $post) {
    $post_image = get_post_meta($post->ID, 'YOUR-CUSTOM-FIELD-NAME-HERE', true);
    return (empty($post_image) ? $picture : $post_image);

    that's it!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Add Link to Facebook
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.