WordPress.org

Ready to get started?Download WordPress

Forums

JSL3 Facebook Wall Feed
[resolved] Change image size? (10 posts)

  1. nicole2292
    Member
    Posted 1 year ago #

    Hello,

    I'm just wondering where / how I can change the size of the images pulled into the feed using this plugin?

    Currently they are tiny at 130px high x 97px wide

    I would like them to be set to a fixed width of 215px (variable height) to work with our layout as the feed is in a sidebar. I could just change the size with CSS if I had a larger image however I cannot scale one up which is only 97px wide to 215px so I need to pull a larger source image in the first place.

    I can't seem to find a setting for this so please tell me what code to change in the plugin files so it pulls a larger version of the images.

    Thanks,

    Nicole

    http://wordpress.org/extend/plugins/jsl3-facebook-wall-feed/

  2. Takanudo
    Member
    Plugin Author

    Posted 1 year ago #

    The plugin uses the image size that is sent by Facebook. I haven't really tried to mess with image sizes, so I don't know how much flexibility Facebook will give you in changing the image size. If you are comfortable with PHP you can play with the function I use to display images.

    1. Open '/wp-content/plugins/jsl3-facebook-wall-feed/php/class-uki-facebook-wall-feed.php'
    2. At line 797 is a function called fb_fix.
    3. You can work with the image width and height there.
  3. Takanudo
    Member
    Plugin Author

    Posted 1 year ago #

    Also, I believe you will get a larger image if you remove the lines that set the height and width that Facebook sends.

    1. Open '/wp-content/plugins/jsl3-facebook-wall-feed/php/class-uki-facebook-wall-feed.php'
    2. Lines 805 and 806 are the following:
      if ( isset( $w ) && isset( $h ) )
      $result .= '" width="' . $w . '" height="' . $h;
    3. Remove lines 805 and 806.
    4. Save the file.
  4. nicole2292
    Member
    Posted 1 year ago #

    Hi Takanudo,

    Thanks heaps for your response.

    I have tried your solution and that does not changes the image size which is pulled. The width and height ($w and $h) are not actually set anywhere and therefore that $result line 806 is not actually rendering in the output.

    I have tried setting $w and $h up manually but that just resizes the same small image which looks terrible.

    Basically changing the width and height does nothing as it is still pulling the image file name which ends in _s.jpg which I assume is the small image. What I really need to do is to pull a different image file so it is the URL of the image file being pulled needs to be changed.

    Any ideas?

  5. nicole2292
    Member
    Posted 1 year ago #

    Hi Takanudo,

    Thanks heaps for your response.

    I have tried your solution and that does not changes the image size which is pulled. The width and height ($w and $h) are not actually set anywhere and therefore that $result line 806 is not actually rendering in the output.

    I have tried setting $w and $h up manually but that just resizes the same small image which looks terrible.

    Basically changing the width and height does nothing as it is still pulling the image file name which ends in _s.jpg which I assume is the small image. What I really need to do is to pull a different image file so it is the URL of the image file being pulled needs to be changed.

    Any ideas?

  6. Takanudo
    Member
    Plugin Author

    Posted 1 year ago #

    The width and height are set in the call to parse_str when w and h are specified in the query string. Unfortunately, the plugin can only display what Facebook sends in its feed. After doing some research, I discovered that changing the _s to a _n will give you a large image. Try changing return $result; to return str_replace('_s, '_n', $result); in the fb_fix function.

  7. gosugimoto
    Member
    Posted 1 year ago #

    was looking for the same thing and... tweaking around line 803 to:

    $stredit = str_replace('_s', '_o', $str);
    $result = '<img src="' . htmlentities( $stredit, ENT_QUOTES, 'UTF-8' ) . '" alt="' . __(

    does the job for me plenty fine

  8. nicole2292
    Member
    Posted 1 year ago #

    That did the trick perfectly! Thanks heaps guys :)

  9. Bramsterdam
    Member
    Posted 1 year ago #

    Hi there,
    got the same problem here, but i'm not really a php'er.
    I got the php file, but now...
    @gosugimoto: where do i place these lines exactly? or wich lines do i have to replace?
    help appreciated.

  10. Bramsterdam
    Member
    Posted 1 year ago #

    oke right!
    got it!
    thanks a lot!!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic