Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • Martin Dougiamas
    Participant

    I’m using an RSS feed from Mastodon, which unfortunately doesn’t include a title or author.

    eg https://openedtech.social/tags/OpenEdTech.rss

    As a partial fix, it would be nice to include a link to the source on every item displayed, but there seems to be no way. I was hoping there was %%link%% in the template, for example.

    Is there any way to achieve a standard link on every item without any title?

    Hi Martin,

    There is no placeholder to insert just the link. But it is possible to add any data from the RSS feed using “hooks”.

    Actions and Filters

    Could you please share your website URL and where you want to display the link?
    I’ll check and suggest the PHP code accordingly.

    Thanks,
    Aakash

    Martin Dougiamas
    Participant

    Thanks, I’m using it here at the moment https://openedtech.global/news/

    You can see the feed there could really use an author on each item, since they are all by different people. The author is actually in the item links, so if I could extract that from the URL using PHP that would be perfect.

    (The entire site is currently being renovated)

    Hi Martin,

    I’ll check and get back to you in a couple of days.

    Thanks,
    Aakash

    Martin Dougiamas
    Participant

    Hey Aakash,

    I never heard back from you. Any updates?

    I still have the problem here: https://openedtech.global/social/

    Regards,
    Martin

    Hi Martin,

    Apologize for the delay. I missed this thread. Since this is a custom requirement, I wrote below modification as you requested.

    Can you please paste the PHP below on your site?

    add_filter( 'srr_mod_item_html', 'srr_link_bottom', 10, 3 );
    function srr_link_bottom( $html, $feed_url, $feed_item ){
        $html[ 'after' ] = $html[ 'after' ] . '<p><a href="' . $feed_item->get_link() . '" target="_blank">' . $feed_item->get_link() . '</a></p>';
        return $html;
    }

    You can follow the articles below, if you are new to inserting PHP code on your site.

    1) https://www.aakashweb.com/articles/create-site-specific-wordpress-plugin-custom-code/
    2) https://www.aakashweb.com/articles/best-methods-to-insert-custom-php-code-in-wordpress/

    Thanks,
    Aakash

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Subscribe for updates

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter