Jump to content
Sign in to follow this  
jpereirinha

RSS on page Main Content

Recommended Posts

jpereirinha

Hi: I'm trying to create a custom page that shows rss feed content from an outside site. Thus, need to assign this custom page template to some pages, each with a different source. Need some help, or better approach to this.

Share this post


Link to post
Share on other sites
[Deleted User]

Hi Jos?©, Have you arleady tried this with the "Wordpress RSS Shortcode" plugin? So you can put it in the content of a page or post.

Share this post


Link to post
Share on other sites
jpereirinha

Hi Jackey, Thanks for the reply. Well, in fact this works, but it lakes on the control of elements. I rather prefer a way where i could draw the content interface.

Share this post


Link to post
Share on other sites
catrina

Have you already tried searching for other RSS plugins that might work the way you want?


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
jpereirinha

Yes, i've already lost some time looking for it, without success. I just need to be able to put something like this on page main content:

<?php
	/*
	Template Name: teste
	*/
	?>
	<?php setup_pagelines_template();
	
	add_action('pagelines_inside_bottom_maincontent', 'rssFeed');
	
	function rssFeed(){
		if(function_exists('fetch_feed')) {
	
		include_once(ABSPATH . WPINC . '/feed.php');
		$feed = fetch_feed('http://feeds.source.rss');
	
		$limit = $feed->get_item_quantity(10);
		$items = $feed->get_items(0, $limit);
	
	}
	if ($limit == 0) echo '<div>A fonte de informa?§??o poder?? estar indispon?­vel.</div>';
	else foreach ($items as $item) : ?>
	
	<div>
		get_permalink(); ?>"
		  title="<?php echo $item->get_date('j F Y @ g:i a'); ?>">
			<?php echo $item->get_title(); ?>
		
	</div>
	<div>
		<?php echo substr($item->get_description(), 0, 200); ?>
		<span>[...]</span>
	</div>
	<?php endforeach;
	
	}[/code]

This is the content of an custom page type that i created, and applied to a test page, but it doesn't show any thing.

Share this post


Link to post
Share on other sites
jpereirinha

Yes, i've already lost some time looking for it, without success. I just need to be able to put something like this on page main content:

<?php
	/*
	Template Name: teste
	*/
	?>
	<?php setup_pagelines_template();
	
	add_action('pagelines_inside_bottom_maincontent', 'rssFeed');
	
	function rssFeed(){
		if(function_exists('fetch_feed')) {
	
		include_once(ABSPATH . WPINC . '/feed.php');
		$feed = fetch_feed('http://feeds.source.rss');
	
		$limit = $feed->get_item_quantity(10);
		$items = $feed->get_items(0, $limit);
	
	}
	if ($limit == 0) echo '<div>A fonte de informa?§??o poder?? estar indispon?­vel.</div>';
	else foreach ($items as $item) : ?>
	
	<div>
		get_permalink(); ?>"
		  title="<?php echo $item->get_date('j F Y @ g:i a'); ?>">
			<?php echo $item->get_title(); ?>
		
	</div>
	<div>
		<?php echo substr($item->get_description(), 0, 200); ?>
		<span>[...]</span>
	</div>
	<?php endforeach;
	
	}[/code]

This is the content of an custom page type that i created, and applied to a test page, but it doesn't show any thing.

Share this post


Link to post
Share on other sites
catrina

Thanks, Martijn. Jose, you should try the hungryfeed plugin and see how it works out.


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×