-
AuthorPosts
-
December 29, 2022 at 8:01 pm #12272BaystreeterParticipant
Hello,
I’m using shortcodes to display RSS feed in a page and several blog posts
I want to use hooks and filters to modify the output, but only if it’s in a post. The output in the page should not be modified.
I tried to use the following but it did not work
<?php
if ( is_single() && ! is_page() ) {
add_filter( ‘srr_mod_item_html’, ‘my_srr_modifier’, 10, 3 );function my_srr_modifier( $html, $feed_url, $feed_item ){
$html[ ‘title’ ] = $html[ ‘title’ ] . ‘ extra text’;
return $html;
}
}
?>Any help is appreciated.
ThanksDecember 29, 2022 at 11:21 pm #12273Aakash ChakravarthyKeymasterHi Bay,
Please follow along the code hint below.
function my_srr_modifier( $html, $feed_url, $feed_item ){ if ( is_single() && 'post' == get_post_type() ) { $html[ 'title' ] = $html[ 'title' ] . 'extra text'; } return $html; } add_filter( 'srr_mod_item_html', 'my_srr_modifier', 10, 3 );
Thanks,
AakashDecember 30, 2022 at 8:31 pm #12274BaystreeterParticipantThanks, that works !!!
Another question.
If I use 2 settings:
#1- count=”10″ display_type=”vertical_ticker” visible_items=”5″
#2- count=”50″ display_type=”vertical_ticker” visible_items=”5″Does #2 increase the page load time substantially?
December 31, 2022 at 9:37 am #12275BaystreeterParticipantAlso I noticed that SRR has made many calls to the database and also increased its size. The number of calls and size exceeded my quotas.
Any tips for reducing the excessive calls and space? like not using images, fewer feed items etc.?
December 31, 2022 at 2:40 pm #12276Aakash ChakravarthyKeymasterHi,
Super RSS Reader displays contents by parsing the RSS feed directly. The RSS feed is however cached by WordPress in DB for 12 hours. Everytime the reader is displayed, it tries to get the feed contents from the cache or it fetches the rss feed directly.
It does not access database except the widget settings.
Rgarding your 2nd question, it depends on the RSS feed contents. If your RSS feed has lots of text and if you are displaying full contents of the feed then the page may get heavier. Otherwise it shouldn’t cause an impact.
Thanks,
AakashJanuary 8, 2023 at 6:55 pm #12347BaystreeterParticipantok, makes sense.
Is there a way to only display feed items that have a summary?
Thanks
February 26, 2023 at 4:56 pm #12592Aakash ChakravarthyKeymasterHi,
Super RSS Reader – PRO has been updated to v4.9.
In this version, you can create a filter with value set as ‘*’ to feed description. This way you can filter out feed items without a description.
Please do upgrade to check it out.
Thanks,
Aakash -
AuthorPosts
- You must be logged in to reply to this topic.