WordPress.org

Ready to get started?Download WordPress

Forums

FBF Facebook page Feed Widget
How can I show full title in FBF widget and not only 80 Characters (10 posts)

  1. clayefeld
    Member
    Posted 1 year ago #

    How can I show the full title in FBF widget and not only 80 Characters?
    THX

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

  2. lakshmananphp
    Member
    Plugin Author

    Posted 1 year ago #

    Hi clayefeld,

    1)Edit the plugin file
    wp-content/plugins/fbf-facebook-page-feed-widget/fbf_facebook_page_feed.php
    2)Go to line number 80. you will find this code.
    $feedtitle ="<h4><a href=".$block->get_permalink()." class='facebook_page-link' ".$link_target.">".substr($block->get_title(), 0, 200)."</a></h4>"; // Title of the update
    3)Replace this with the following code
    $feedtitle ="<h4><a href=".$block->get_permalink()." class='facebook_page-link' ".$link_target.">".$block->get_title()."</a></h4>"; // Title of the update
    4)Save the file.
    5)Take a backup of the old file and overwrite the modified file in your website(wp-content/plugins/fbf-facebook-page-feed-widget/).

    We have removed the character limit now.

    You should be able to show full title.

    This code is tested in my local machine.

    Try it out. Let me know if there is any issues.

    Thanks
    Lakshmanan

  3. clayefeld
    Member
    Posted 1 year ago #

    Thank you for your quick response! unfortunately it is not working. I've always 80 characters. I've also tried to change the value earlier of line 80 for example:

    ($block->get_title(), 0, 200)
    to
    ($block->get_title(), 5, 200)

    but with no result. I'm losing the first 5 letters of the title but not gaining anyone!

  4. lakshmananphp
    Member
    Plugin Author

    Posted 1 year ago #

    Hi clayefeld,

    I think facebook limits the characters in the title.

    Try replacing this

    ($block->get_title(), 0, 200)

    with

    ($block->get_description(), 0, 200)

    Please Keep me updated on this.

    Thanks,
    Lakshmanan.

  5. clayefeld
    Member
    Posted 1 year ago #

    Thanks, it works for me!!!

  6. ShoGun.se
    Member
    Posted 1 year ago #

    How do I add "..." after the last character automatically?

    //Robert

  7. lakshmananphp
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Robert,

    Add "..." to this line

    $feedtitle ="<h4><a href=".$block->get_permalink()." class='facebook_page-link' ".$link_target.">".substr($block->get_title(), 0, 200)."</a></h4>"; // Title of the update

    Example :

    $feedtitle ="<h4><a href=".$block->get_permalink()." class='facebook_page-link' ".$link_target.">".substr($block->get_title(), 0, 200)."...</a></h4>"; // Title of the update

    Add before closing the anchor tag of the title.

    Let me know if you have any issues.

    Thanks
    Lakshmanan

  8. ShoGun.se
    Member
    Posted 1 year ago #

    @Lakshmanan PHP

    So easy =) Thanks!

    Is it possible to only show the first row? Have changed
    get_title(), 0, 200) to get_title(), 0, 60) but it doesn't seem to be number of characters but some kind of length.

    Sometimes it stays in one row and sometimes it gets two rows. I would like to have it only one row... http://t3sjalvskydd.se/nyheter-event-2/facebook/

    I asked about this in another thread (sorry for bumping but thought it might be good to put it here as it is related)...

    Is it possible to not repeat the feed title twice? Now it´s one as a link (and headline) and then one with plain text right under...

    Further, can I put a link to "Continue reading →" (same as feed title) and take away "The post FOUNDATION COURSE – CORE COMBATIVES appeared first on T3 SJÄLVSKYDD."

  9. lakshmananphp
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Robert,

    Yes Facebook repeats the title in description.

    Try this quick fix to avoid repeating same title in description

    Add these two lines of code before $returnMarkup .= "<div class=\"fbf_desc\">".$desc."</div>"; // Full content

    $feedtitle_raw = html_entity_decode(substr($block->get_title(), 0, 200), ENT_COMPAT, 'UTF-8');; // Raw Title of the update
    $desc = str_replace($feedtitle_raw, '', $desc); // To avoid repeating title

    Let me know if you encounter any issues.

    Thanks
    Lakshmanan

  10. ShoGun.se
    Member
    Posted 1 year ago #

    @lakshmananphp

    Worked GREAT! You are awesome! I really mean it, giving fast and detailed support for a free plugin, much appreciated!

    No stress but would you care to help me solve the other "problems" as well? I try to not ask too personal questions but those that more people would like or need.

    Keep up the great work!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic