Linking stylesheet to RSS feeds

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

Linking stylesheet to RSS feeds

by RePost :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is there any way to link my stylesheet with WP's RSS feeds?

When it creates my feeds, WP grabs the images from my blog content and
ignores the stylesheet, so I have images bumping up against text:
http://bit.ly/sBCvw

I've avoided this with my main feed by hand-coding the XML (replacing my
styles with generic CSS) and sending it to FeedBurner:
http://bit.ly/atybz

However, now I'd like to set up Tags and Categories feeds, and would
prefer to automate the process using WP's built-in feeds. I don't see
any way to do this.
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by Ryan McCue-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 16/06/2009 11:36 AM, RePost wrote:
> Is there any way to link my stylesheet with WP's RSS feeds?

How do you intend to "link" it? RSS feeds contain just the information,
not styling. The way RSS feeds with styling work is by using inline styling.

--
Ryan McCue
<http://cubegames.net/>

_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by Bueltge :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jun 16, 2009 at 8:42 AM, Ryan McCue<lists@...> wrote:
> On 16/06/2009 11:36 AM, RePost wrote:
>>
>> Is there any way to link my stylesheet with WP's RSS feeds?
>
> How do you intend to "link" it? RSS feeds contain just the information, not
> styling. The way RSS feeds with styling work is by using inline styling.

+100 for this answer

>
> --
> Ryan McCue
> <http://cubegames.net/>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers@...
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by RePost :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Frank Bueltge wrote:
> On Tue, Jun 16, 2009 at 8:42 AM, Ryan McCue<lists@...> wrote:
>  
>> On 16/06/2009 11:36 AM, RePost wrote:
>>    
>>> Is there any way to link my stylesheet with WP's RSS feeds?
>>>      
>> How do you intend to "link" it? RSS feeds contain just the information, not
>> styling. The way RSS feeds with styling work is by using inline styling.
>>    

There's plenty of instruction on the Web about linking stylesheets to
RSS feeds. This for example:
http://mondaybynoon.com/2006/08/14/beginning-to-style-your-rss-feed/

But that doesn't relate to my question, which involved styling the
WordPress feed(s).

I'd like to style my WordPress feed. Can I style the feed? How can I
style the feed? Inline, you say? How can I add inline styles to my feed?

Here are the other key points of my message:

When it creates my feeds, WP grabs the images from my blog content and
ignores the stylesheet, so I have images bumping up against text:
http://bit.ly/sBCvw

I've avoided this with my main feed by hand-coding the XML (replacing my
styles with generic CSS) and sending it to FeedBurner:
http://bit.ly/atybz

Is there any way, other than to hand-style my feed, to get WP to create
a feed where the text flows around the images?

Thanks.
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by Ryan McCue-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 16/06/2009 5:46 PM, RePost wrote:
> There's plenty of instruction on the Web about linking stylesheets to
> RSS feeds. This for example:
> http://mondaybynoon.com/2006/08/14/beginning-to-style-your-rss-feed/

That relates to the viewing of an XML file, such as in a browser, when
you open the *actual XML file*, not when it's being aggregated (i.e. in
a feed reader).

> I'd like to style my WordPress feed. Can I style the feed? How can I
> style the feed? Inline, you say? How can I add inline styles to my feed?

You have to have the styles inline in the posts, which is why it doesn't
work very well for WordPress. Theoretically, you could make a shortcode
that would use classes on the site and inline the styles in the feeds.

--
Ryan McCue
<http://cubegames.net/>

_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by Austin Matzko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jun 16, 2009 at 2:46 AM, RePost <repost_08@...> wrote:
> I'd like to style my WordPress feed. Can I style the feed? How can I style the feed? Inline, you say? How can I add inline styles to my feed?

You could make inline markup changes to your feed by conditionally
attaching a callback filter to "the_content", etc., whenever is_feed()
returns true:

if ( is_feed() ) {
   add_filter('the_content', 'my_rss_markup_replace');
}

[snip]

function my_rss_markup_replace($content = '')
{
   return preg_replace('#(<img[^>]*>)#', '<div
style="margin:10px;">$1</div>', $content);
}
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by JAYMIN PATEL :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can you separate images from your content?

if you can, you can put images in media:content or media:thumbnail.

Read more here..
http://video.search.yahoo.com/mrss

- JK

> -----Original Message-----
> From: if.website@...
> Sent: Tue, 16 Jun 2009 05:39:38 -0500
> To: wp-hackers@...
> Subject: Re: [wp-hackers] Linking stylesheet to RSS feeds
>
> On Tue, Jun 16, 2009 at 2:46 AM, RePost <repost_08@...> wrote:
>> I'd like to style my WordPress feed. Can I style the feed? How can I
>> style the feed? Inline, you say? How can I add inline styles to my feed?
>
> You could make inline markup changes to your feed by conditionally
> attaching a callback filter to "the_content", etc., whenever is_feed()
> returns true:
>
> if ( is_feed() ) {
>    add_filter('the_content', 'my_rss_markup_replace');
> }
>
> [snip]
>
> function my_rss_markup_replace($content = '')
> {
>    return preg_replace('#(<img[^>]*>)#', '<div
> style="margin:10px;">$1</div>', $content);
> }
> _______________________________________________
> wp-hackers mailing list
> wp-hackers@...
> http://lists.automattic.com/mailman/listinfo/wp-hackers

____________________________________________________________
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by RePost :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Austin Matzko wrote:

> On Tue, Jun 16, 2009 at 2:46 AM, RePost <repost_08@...> wrote:
>  
>> I'd like to style my WordPress feed. Can I style the feed? How can I style the feed? Inline, you say? How can I add inline styles to my feed?
>>    
>
> You could make inline markup changes to your feed by conditionally
> attaching a callback filter to "the_content", etc., whenever is_feed()
> returns true:
>
> if ( is_feed() ) {
>    add_filter('the_content', 'my_rss_markup_replace');
> }
>
> [snip]
>
> function my_rss_markup_replace($content = '')
> {
>    return preg_replace('#(<img[^>]*>)#', '<div
> style="margin:10px;">$1</div>', $content);
> }
> _______________________________________________

Interesting idea, Austin. I'll knock it around.

For the time being, I'm going with custom feeds for the important stuff
and will consider dialing back the lesser feeds from RSS2 to RSS. No
problem with bumping graphics there, but no media enclosures, either.


_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by Eric Marden-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jun 16, 2009, at 2:47 AM, Frank Bueltge wrote:

> On Tue, Jun 16, 2009 at 8:42 AM, Ryan McCue<lists@...>  
> wrote:
>> On 16/06/2009 11:36 AM, RePost wrote:
>>>
>>> Is there any way to link my stylesheet with WP's RSS feeds?
>>
>> How do you intend to "link" it? RSS feeds contain just the  
>> information, not
>> styling. The way RSS feeds with styling work is by using inline  
>> styling.
>
> +100 for this answer

You can use both CSS and XSL/T to style RSS (which is just XML),  
including linking external style sheets.

http://www.xefteri.com/articles/show.cfm?id=24
http://interglacial.com/~sburke/stuff/pretty_rss.html
http://www.oreillynet.com/pub/a/network/2005/07/01/rss.html



- Eric Marden
__________________________________
http://xentek.net/code/wordpress/
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by Joost de Valk-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Disclaimer: I didn't follow this thread entirely, so sorry if I say
something that's already been said.

Wouldn't it be cool if WordPress automatically replaced
class="alignright" and "alignleft" etc with good inline CSS? That's
always annoyed me a bit... Might make a plugin for that, since it's
actually pretty darn easy to do, but still, shouldn't that be in core?

Best,
Joost

RePost wrote:

> Austin Matzko wrote:
>> On Tue, Jun 16, 2009 at 2:46 AM, RePost <repost_08@...> wrote:
>>> I'd like to style my WordPress feed. Can I style the feed? How can I
>>> style the feed? Inline, you say? How can I add inline styles to my
>>> feed?
>>
>> You could make inline markup changes to your feed by conditionally
>> attaching a callback filter to "the_content", etc., whenever is_feed()
>> returns true:
>>
>> if ( is_feed() ) {
>>    add_filter('the_content', 'my_rss_markup_replace');
>> }
>>
>> [snip]
>>
>> function my_rss_markup_replace($content = '')
>> {
>>    return preg_replace('#(<img[^>]*>)#', '<div
>> style="margin:10px;">$1</div>', $content);
>> }
>> _______________________________________________
>
> Interesting idea, Austin. I'll knock it around.
>
> For the time being, I'm going with custom feeds for the important
> stuff and will consider dialing back the lesser feeds from RSS2 to
> RSS. No problem with bumping graphics there, but no media enclosures,
> either.
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers@...
> http://lists.automattic.com/mailman/listinfo/wp-hackers 

--
*Joost de Valk*
SEO & Web Development (Magento & WordPress)
OrangeValley <http://www.orangevalley.nl> & Yoast <http://yoast.com>
E: joost@... <mailto:joost@...> -
joost@... <mailto:joost@...>
T: +31624555808 | @yoast <http://twitter.com/yoast> on Twitter
W: http://yoast.com/
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by Peter Westwood :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 17 Jun 2009, at 07:04, RePost wrote:

> Austin Matzko wrote:
>> On Tue, Jun 16, 2009 at 2:46 AM, RePost <repost_08@...> wrote:
>>
>>> I'd like to style my WordPress feed. Can I style the feed? How can  
>>> I style the feed? Inline, you say? How can I add inline styles to  
>>> my feed?
>>>
>>
>> You could make inline markup changes to your feed by conditionally
>> attaching a callback filter to "the_content", etc., whenever  
>> is_feed()
>> returns true:
>>
>> if ( is_feed() ) {
>>   add_filter('the_content', 'my_rss_markup_replace');
>> }
>>
>> [snip]
>>
>> function my_rss_markup_replace($content = '')
>> {
>>   return preg_replace('#(<img[^>]*>)#', '<div
>> style="margin:10px;">$1</div>', $content);
>> }
>> _______________________________________________
>

Looking quickly at that code I have a feeling it is safer to always  
add the filter and place the is_feed() check inside the function  
attached to the filter.

When the plugin file is included is_feed() will always return false as  
the query hasn't run yet.

westi
--
Peter Westwood
http://blog.ftwr.co.uk | http://westi.wordpress.com
C53C F8FC 8796 8508 88D6 C950 54F4 5DCD A834 01C5

_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by Ryan McCue-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 17/06/2009 4:09 PM, Eric Marden wrote:
> You can use both CSS and XSL/T to style RSS (which is just XML),
> including linking external style sheets.

As I mentioned, this is only for viewing the feed in the browser, and it
doesn't actually display on Firefox (or Safari, from memory), as they
have their own XSLT styles. As far as I know, RePost wants to style it
in an aggregator (feed reader).

--
Ryan McCue
<http://cubegames.net/>

_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by Austin Matzko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jun 17, 2009 at 2:06 AM, Peter
Westwood<peter.westwood@...> wrote:

>> Austin Matzko wrote:
>>> if ( is_feed() ) {
>>>  add_filter('the_content', 'my_rss_markup_replace');
>>> }
>>>
>>> [snip]
>>>
>>> function my_rss_markup_replace($content = '')
>>> {
>>>  return preg_replace('#(<img[^>]*>)#', '<div
>>> style="margin:10px;">$1</div>', $content);
>>> }
>>> _______________________________________________
>>
>
> Looking quickly at that code I have a feeling it is safer to always add the
> filter and place the is_feed() check inside the function attached to the
> filter.
>
> When the plugin file is included is_feed() will always return false as the
> query hasn't run yet.

Yes, I am assuming a little knowledge of the WordPress action hook
API.  I didn't mean for anyone to copy and paste that straight into a
file (that's why the "[snip]").  The is_feed() block should be part of
a callback for the template_redirect hook.
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by Eric Marden-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jun 17, 2009, at 3:06 AM, Ryan McCue wrote:

> On 17/06/2009 4:09 PM, Eric Marden wrote:
>> You can use both CSS and XSL/T to style RSS (which is just XML),  
>> including linking external style sheets.
>
> As I mentioned, this is only for viewing the feed in the browser,  
> and it doesn't actually display on Firefox (or Safari, from memory),  
> as they have their own XSLT styles. As far as I know, RePost wants  
> to style it in an aggregator (feed reader).

Most feed readers are browsers (or live there) and will display styles  
from external style sheets with out issue. The XSL/T may or may not be  
supported.

- Eric Marden
__________________________________
http://xentek.net/code/wordpress/





_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by Jeremy Clarke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

note: there is a filter for  'the_content_rss'

--
Jeremy Clarke | http://jeremyclarke.org
Code and Design | http://globalvoicesonline.org
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by scribu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

the_content_rss will not be applied as you'd expect.

I know, because I've tried it for this exact reason: adding inline
styles to feeds.

On 6/17/09, Jeremy Clarke <jer@...> wrote:

> note: there is a filter for  'the_content_rss'
>
> --
> Jeremy Clarke | http://jeremyclarke.org
> Code and Design | http://globalvoicesonline.org
> _______________________________________________
> wp-hackers mailing list
> wp-hackers@...
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


--
http://scribu.net
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by Joost de Valk-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Me too, been there done that, it works weirdly... (and there's no real
need for it, the_content combined with is_feed does the job well)

scribu wrote:

> the_content_rss will not be applied as you'd expect.
>
> I know, because I've tried it for this exact reason: adding inline
> styles to feeds.
>
> On 6/17/09, Jeremy Clarke<jer@...>  wrote:
>    
>> note: there is a filter for  'the_content_rss'
>>
>> --
>> Jeremy Clarke | http://jeremyclarke.org
>> Code and Design | http://globalvoicesonline.org
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers@...
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
>>      
>
>
>    

--
*Joost de Valk*
SEO & Web Development (Magento & WordPress)
OrangeValley <http://www.orangevalley.nl> & Yoast <http://yoast.com>
E: joost@... <mailto:joost@...> -
joost@... <mailto:joost@...>
T: +31624555808 | @yoast <http://twitter.com/yoast> on Twitter
W: http://yoast.com/
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by RePost :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ryan McCue wrote:
> On 17/06/2009 4:09 PM, Eric Marden wrote:
>> You can use both CSS and XSL/T to style RSS (which is just XML),
>> including linking external style sheets.
>
> As I mentioned, this is only for viewing the feed in the browser, and
> it doesn't actually display on Firefox (or Safari, from memory), as
> they have their own XSLT styles. As far as I know, RePost wants to
> style it in an aggregator (feed reader).
>
I'm glad to see a real conversation develop here. Hope it has some
impact on future iterations of the WP RSS2 feed.

I've never been happy with feed readers, but also never considered that
my feed might display differently in feed readers vs. browsers.
Hand-coding and FeedBurner seemed to take care of that problem. My
concern has always been the way raw feeds look in the browser. And if
the feed is picking up graphics from the content, it usually looks bad.

Curiously, I just styled and syndicated a Blogger feed for a client
(using FeedBurner BuzzBoost) and, I don't know why, but the text flowed
around the graphics in that feed, with no extra editing.

Great gaps clearly exist in my understanding of how feeds work. But my
images are floated with such styles as "class=left;" and so on. If there
were some way for WP to strip those styles and float images so
everything looks nice and neat, I'd be happy. Or barring that, just
strip the images and preserve the media enclosures!

_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by Lynne Pope :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/6/18 RePost <repost_08@...>

> Ryan McCue wrote:
>
>> On 17/06/2009 4:09 PM, Eric Marden wrote:
>>
>>> You can use both CSS and XSL/T to style RSS (which is just XML),
>>> including linking external style sheets.
>>>
>>
>> As I mentioned, this is only for viewing the feed in the browser, and it
>> doesn't actually display on Firefox (or Safari, from memory), as they have
>> their own XSLT styles. As far as I know, RePost wants to style it in an
>> aggregator (feed reader).
>>
>>  I'm glad to see a real conversation develop here. Hope it has some impact
> on future iterations of the WP RSS2 feed.
>
> I've never been happy with feed readers, but also never considered that my
> feed might display differently in feed readers vs. browsers.


That's the thing - feed readers and aggregators are not web browsers. They
expect to get plain content, not a web page and have their own user
interfaces for displaying the XML data they receive.

Even those aggregators that preserve XSL styling can usually be overridden
by user preferences so once your feed has been accessed by someone (or by an
app) there is really no control over how it is presented. The same is also
true for web pages actually - the styling we provide can be completely
changed by the person viewing our sites.

I've never used this plugin, but it might provide a starting point for
styling your feeds: http://wordpress.org/extend/plugins/feed-styler/ It adds
inline styling.

Lynne
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: Linking stylesheet to RSS feeds

by RePost :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lynne Pope wrote:

> That's the thing - feed readers and aggregators are not web browsers. They
> expect to get plain content, not a web page and have their own user
> interfaces for displaying the XML data they receive.
>
> Even those aggregators that preserve XSL styling can usually be overridden
> by user preferences so once your feed has been accessed by someone (or by an
> app) there is really no control over how it is presented. The same is also
> true for web pages actually - the styling we provide can be completely
> changed by the person viewing our sites.
>
> I've never used this plugin, but it might provide a starting point for
> styling your feeds: http://wordpress.org/extend/plugins/feed-styler/ It adds
> inline styling.
>
>  

I did try out Feed Styler (no longer supported) during the past few
days, Lynne. Only seems to work with FeedBurner feeds and doesn't affect
the raw feed when you view it in the browser.

Didn't think to check it in a feed reader!

_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers
< Prev | 1 - 2 | Next >