WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. akedv
    Member
    Posted 1 year ago #

    Hi,

    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.

    regards
    alex

    http://wordpress.org/extend/plugins/add-link-to-facebook/

  2. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year 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
    Member
    Posted 1 year ago #

    great thx, i found the answer here:

    http://forum.faircode.eu/forums/topic/how-to-use-link-picture-from-custom-field/

    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

About this Topic

Tags

No tags yet.