-
AuthorPosts
-
March 22, 2024 at 2:10 pm #14440Martin DougiamasParticipant
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?
March 23, 2024 at 12:43 am #14445Aakash ChakravarthyKeymasterHi Martin,
There is no placeholder to insert just the link. But it is possible to add any data from the RSS feed using “hooks”.
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,
AakashMarch 25, 2024 at 10:18 am #14451Martin DougiamasParticipantThanks, 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)
March 26, 2024 at 12:15 pm #14454Aakash ChakravarthyKeymasterHi Martin,
I’ll check and get back to you in a couple of days.
Thanks,
AakashApril 19, 2024 at 8:37 pm #14565Martin DougiamasParticipantHey Aakash,
I never heard back from you. Any updates?
I still have the problem here: https://openedtech.global/social/
Regards,
MartinApril 20, 2024 at 12:40 am #14566Aakash ChakravarthyKeymasterHi 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,
AakashJune 7, 2024 at 5:28 pm #14765Martin DougiamasParticipantExcellent thanks!
June 10, 2024 at 9:25 pm #14771Aakash ChakravarthyKeymasterHi Martin,
Excellent! The page looks great 🙂
Have a nice day.Thanks,
Aakash -
AuthorPosts
- The topic ‘Is there any way to’ is closed to new replies.