-
AuthorPosts
-
December 31, 2015 at 3:51 am #726533
Hi is there anyway to implement rss feeds with accordion to be on a page?
December 31, 2015 at 4:36 am #726558Hi there,
Thanks for posting in.
It’s not possible, it should be in the correct format so RSS reader can fetch it correctly. Though, I’m not sure why you need it like that? Or do you wish to display RSS feed content from another URL to your site?
Thanks.
December 31, 2015 at 5:18 am #726580Hey. Yeah i want to display a rss feed content from another url to my site, and display that content in an accordion format. Is there a way to do that?
December 31, 2015 at 6:20 am #726617Hi there,
Not possible by available options, but doable by custom development. I can’t really provide a complete solution but I can provide some recommendations.
For example, you can use the same code here:
https://codex.wordpress.org/Function_Reference/fetch_feed
But instead of using
<ul><li></li></ul>
, you will replace them with accordion’s shortcodes.Example, this block of code:
<ul> <?php if ( $maxitems == 0 ) : ?> <li><?php _e( 'No items', 'my-text-domain' ); ?></li> <?php else : ?> <?php // Loop through each feed item and display each item as a hyperlink. ?> <?php foreach ( $rss_items as $item ) : ?> <li> <a href="<?php echo esc_url( $item->get_permalink() ); ?>" title="<?php printf( __( 'Posted %s', 'my-text-domain' ), $item->get_date('j F Y | g:i a') ); ?>"> <?php echo esc_html( $item->get_title() ); ?> </a> </li> <?php endforeach; ?> <?php endif; ?> </ul>
Should be changed to:
$shortcode = ''; if ( $maxitems >= 1 ) { $shortcode.='[x_accordion id="my-feeds-accordion"]'; foreach ( $rss_items as $item ) : $shortcode.='[x_accordion_item title="'.$item->get_title().'" parent_id="my-feeds-accordion"]'.$item->get_description().'[/x_accordion_item]'; endforeach; $shortcode.='[/x_accordion]'; echo do_shortcode( $shortcode ); }
Thanks!
January 2, 2016 at 4:12 am #728427hi sorry i haven’t manage to try your recommendation as i’m now having trouble fetching the rss feed. is there a theme conflict with fetching this link? it returns a timeout.
January 2, 2016 at 6:06 am #728499Thanks for writing in! It sounds like you might be having an issue with a third party plugin or script. Regretfully, we cannot provide support for third party plugins or scripts as our support policy in the sidebar states due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to X will need to be directed to the original developer.
Thank you for your understanding.
March 1, 2016 at 6:08 am #818265Hi, noted. Just wanted to update you that I’ve managed to implement rss with accordion. Thanks for your help!
Also, is there a way i can add a line break after every sentence or specific data? Cause it appears as one whole chunk now.
March 1, 2016 at 6:54 am #818352Hi Brandon,
Please provide us with the URL of page where you have the feed so we can take a closer look and provide you with a tailored response.
Thank you!
March 1, 2016 at 7:13 am #818375This reply has been marked as private.March 1, 2016 at 10:32 am #818637Hi there,
Thanks for updating. Simple there is no way to control the text since they are just plain text without any tag. If you want to change line height, font-size, color etc. then you can use the following selector :
.x-accordion-inner { line-height: 28px; }
Hope this helps.
Cheers!
-
AuthorPosts