How do I use PHP to put an RSS feed into my website sidebar?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
chapchap70
Posts: 210
Joined: Thu 18 Nov 2010, 05:39
Location: The Island Of Long (NY, USA)

How do I use PHP to put an RSS feed into my website sidebar?

#1 Post by chapchap70 »

I would like to put my wordpress blog feed into my website sidebar. The problem is, I do not understand the instructions from Wordpress.

Here is the link to the wordpress instructions. https://codex.wordpress.org/WordPress_Feeds


Here is the Templated framework design I am using; the portion I want my blog into.


Code: Select all

<header>
								<h2>Mauris vulputate</h2>
							</header>
							<ul class="style">
								<li>
									<p class="posted">May 21, 2014  |  (10 )  Comments</p>
									<p><a href="#">Nullam non wisi a sem eleifend. Donec mattis libero eget urna. Pellentesque viverra enim.</a></p>
								</li>
								<li>
									<p class="posted">May 18, 2014  |  (10 )  Comments</p>
									<p><a href="#">Nullam non wisi a sem eleifend. Donec mattis libero eget urna. Pellentesque viverra enim.</a></p>
								</li>
							</ul>
						</section>
I know how to put my blog feed into a link but what I am trying to do is have the posted content appear on my website automatically when I post to my blog. Is this two or three simple one line scripts or is it more complicated?

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

Re: How do I use PHP to put an RSS feed into my website sidebar?

#2 Post by jamesbond »

chapchap70 wrote:I know how to put my blog feed into a link but what I am trying to do is have the posted content appear on my website automatically when I post to my blog. Is this two or three simple one line scripts or is it more complicated?
You need to extract the content of the feed (they are in XML), parse it, and then output it as HTML fragment. See http://stackoverflow.com/questions/1094 ... javascript.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
puppy_apprentice
Posts: 299
Joined: Tue 07 Feb 2012, 20:32

#3 Post by puppy_apprentice »

Try those tools:

http://www.masternewmedia.org/content_d ... -03-30.htm

What is your blog and page address?

chapchap70
Posts: 210
Joined: Thu 18 Nov 2010, 05:39
Location: The Island Of Long (NY, USA)

#4 Post by chapchap70 »

Thanks guys.

The site still is a work in progress and is currently in html using the Hiawatha server. I might change to php instead.

http://www.globalwarmingllc.com
https://globalwarmingllc.wordpress.com/
Last edited by chapchap70 on Mon 28 Dec 2015, 06:03, edited 1 time in total.

User avatar
puppy_apprentice
Posts: 299
Joined: Tue 07 Feb 2012, 20:32

#5 Post by puppy_apprentice »

Maybe you can try to use XSLT:

https://en.wikipedia.org/wiki/XSLT

inside html iframe tag (without PHP, but you will have to copy your rss.xml to your web server every time you write new blog entry):

http://www.w3schools.com/tags/tag_iframe.asp

Or you can try to put:

https://globalwarmingllc.wordpress.com/feed/

inside iframe tag on your web page.

Post Reply