WordPress.org

Ready to get started?Download WordPress

Forums

FBF Facebook page Feed Widget
Show Just Title & Photo (2 posts)

  1. RGardella
    Member
    Posted 1 year ago #

    Hi -- strange question -- I am working for an organization that tends to be a bit long-winded with their Facebook posts. I'd like to show the title of the facebook posts along with the photo from the posts. Right now to show the photo I have to show the description, which tend to be very long. Can you suggest a way to do this, or add the "title + photo" as an option in your next release?

    Thanks, I love the plug-in!

    http://wordpress.org/extend/plugins/fbf-facebook-page-feed-widget/

  2. lakshmananphp
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Gardella,

    You can show photos and title by doing the following modification

    1)Edit the plugin file
    wp-content/plugins/fbf-facebook-page-feed-widget/fbf_facebook_page_feed.php
    2)add the follwing code (which will retrieve only images from description) before this line
    if ($options['update'] != '') {
    // The code to be added is given below

    $images=preg_match_all('/<img.+src=[\'"](?P<src>.+)[\'"].*>/i', $desc, $image);
    $desc="";
    $array_img=0;
    foreach($image as $img){
    $desc .= $img[$array_img].'<br>';
    $array_img++;
    }
    $returnMarkup .= "<div class=\"fbf_desc\">".$desc."</div>"; // Full content
    }

    3)Save the file.
    4)Take a backup of the old file and overwrite the modified file in your website(wp-content/plugins/fbf-facebook-page-feed-widget/).

    Note :
    Show description should be enabled
    and Show avatar should be disabled in widget settings.

    Now the images should be shown without description.

    Please let me know if you have any issues.

    Thanks
    Lakshmanan.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic