Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hi there, you mean like a “read more” link. Like WordPress excerpts? Not possible yet but good suggestion!

    Thread Starter kjh290984

    (@kjh290984)

    Kind of. I meant the ability to click the excerpt itself. But a “read more” link would be great.

    Is this not possible due to Facebook restrictions? Or is it something I could look at if I was pointed to the correct place in the script?

    Plugin Author Danny van Kooten

    (@dvankooten)

    Right now, people can click the timestamp or the likes and comment count to go to the post on Facebook. So it’s definitely possible.

    I will implement a way to add a “read more” link (or any text you want) in the next version of the plugin.

    If you know your way around PHP you could add this yourself in the plugin files but it will be overwritten on the next plugin update. My suggestion would be to wait a few days until I get the next update ready. πŸ™‚

    Thread Starter kjh290984

    (@kjh290984)

    Great, thank you! That’s really helpful.

    danrknudsen

    (@maildanrknudsendk)

    I totally agree with kjh290984 – superb plugin. But the read-more possibility is missing. If thats contained in an near-up-coming update – i’ll definitely will send money πŸ˜‰

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hi guys, just added this to the plugin. The way you change the “read more” is similar to the default WordPress excerpt.

    You can add the following snippet to your theme functions.php file.

    function my_rfbp_read_more($more, $link)
    {
        return '<a href="'. $link . '">Read more Β»</a>';
    }
    
    add_filter('rfbp_read_more', 'my_rfbp_read_more', 10, 2);

    Note that this will only append the “read more” link to posts that have actually been shortened. If you want to append a “read more” link to all posts, regardless of whether they have been shortened or not, use the following snippet.

    function my_rfbp_content($content, $link)
    {
        return $content . '<a href="' . $link . '">Read more &raquo;</a>';
    }
    
    add_filter('rfbp_content', 'my_rfbp_content', 10, 2);
    danrknudsen

    (@maildanrknudsendk)

    Thats was fast πŸ˜‰

    But – dammit – my theme seems to have some kind of function-add-on that removes the extra function.

    I installed it with the “Code snippet”-plugin to be sure it was done right. And nothing happens. But if I make the exact same installation on my private homepage it works like a charm…

    Besides the function.php-file there is a functions.wp-scripts.php – one of the things it does is:

    /**
    * Remove a registered script.
    *
    * @since r16
    * @see WP_Scripts::remove() For parameter information.
    */

    Any suggestions?

    Plugin Author Danny van Kooten

    (@dvankooten)

    I’m not familiar withe the Code Snippets plugin but are you sure you’re adding the function to your theme its functions.php file, located in /wp-content/themes/your-theme/functions.php?

    I would just add the filter there manually. Very unlikely that it won’t work that way. πŸ™‚

    danrknudsen

    (@maildanrknudsendk)

    I tried thats first – but since it didn’t work I thought that maybe I did something wrong. Then I tried the snippet-plugin.

    And when THAT didn’t work I tried to make the same installation on a different page with a different theme…and THAT worked…

    So it seems to be related to the theme…maybe πŸ˜‰

    danrknudsen

    (@maildanrknudsendk)

    Your update of the plugin solved the problem…I had’nt seen that you already had done that…sorry for the trouble!

    I’ll hurry to paypal πŸ˜‰

    Plugin Author Danny van Kooten

    (@dvankooten)

    Ah, so that was the culprit, haha. The filter is only available since version 1.7.3 so that must be it. Glad you figured it out.

    Thanks for the (future) donation, appreciate it! A review on the plugin would also make me really happy.

    Mihai

    (@mikymroyahoocom)

    A little add-n, in case someone needs it.
    For opening the link in a new tab/page:

    function my_rfbp_content($content, $link)
    {
        return $content . '<a href="' . $link . '" target=_blank >Read more &raquo;</a>';
    }
    
    add_filter('rfbp_content', 'my_rfbp_content', 10, 2);
Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Add Link to Excerpt’ is closed to new replies.