![]() Many people depend on RSS feed because most of us struggle to make time for everything, let alone going straight to a website and reading a single blog. It delivers them to multiple readers who subscribed to your blog or website. With the feed reader, it continuously collects the data from your website. More than that, it has several benefits to you and your visitors that we will share in this article shortly. Not just that, you can distribute multiple headlines, news, and blogs to hundreds – or even thousands of people. This plugin automatically sends your blog content to your readers through RSS Feed. But let me tell you that it is one of the people’s misconceptions nowadays. We’ve got a “guard clause” that exits early if no value is found for the link custom field.Some people think using WordPress RSS Feed Plugins isn’t applicable today. A boolean that signals whether or not you want WordPress to make the field a string for you.The post ID the in-the-Loop function get_the_ID() works fine here.We explain get_post_meta() in more detail in our introduction to custom fields. That’s the role of get_post_meta(): get_post_meta() $link = get_post_meta( Okaay: what’s this filter function doing? Well, our links are just regular posts, with a custom field-creatively named link-where the linked-to URL is stored. What we’re doing is trying to fetch that custom field for every post. Generally, the most specific hook you can find is best, and there are enough for feeds: here’s the best “list” in the Codex. The result is the same, but using the_content incurs a very marginal extra-processing penalty on every request where the filter is invoked. the_content_rss was deprecated in WordPress 2.9 because there was value in having the hook carry information about different feed formats (the esoteric “RSS” vs “Atom” stuff we mentioned earlier).Īs a note, you can also make this work with a hook onto the_content itself. Then, you’d just want to use the conditional tag is_feed() to only impact your feed and not your whole site. For changing excerpts, it’s the_excerpt_rss. If you want to change the title, you can hook into the_title_rss. Among the special “feed” filters, this one is actually an oddball. So we’re using the the_content_feed filter to make our code do something. But if you look at them, you’ll see they look a lot like glorified Loop-containing members of the template hierarchy (from a theme)-which they nearly are. Because that’s a part of core, you’re going to want to use hooks to change things in them. I made a new plugin that just has the following code inside of it: add_filter( 'the_content_feed', 'wpshout_link_in_feed' ) įunction wpshout_link_in_feed( $content ). Let’s get to it! The Code to Add Our Links to the Feed So here, we’ll explain how we’re showing that custom data inside the body of our RSS feed, to save our RSS readers an extra click and a few seconds a day. In the backend, those links have a custom field (also known as “post meta”) that powers a lot of the linking to them.Īnd previously, the RSS feed didn’t do a great job of making those links easy to follow: people would have to click from the feed to our site to see what the linked content was, and then visit it. As you probably know, we regularly post links to cool things around the internet. This week, I finally got around to a bit of RSS cleanup. When we forgot, people would have to click from the feed to our site to see what the linked content was, and then visit it. Then RSS is friggin’ sweet! Why I Changed the WPShout RSS Feed ![]() ![]() Or perhaps you want to make new posts trigger another action (tweet at put your iPad in airplane mode! turn off your fridge!) via a tool like IFTTT. This may seem unimportant-until you want the fact that you’ve published new data on your WordPress site to trigger some action, like sending an email in MailChimp. One of the really great things about WordPress is that it will publish an RSS feed for you, at /feed/. For example, “Atom” is a common format for data feed publishing, which are typically and casually called “RSS feeds.” Technically, there are a few different common formats for “RSS”-only some of which are RSS. Let us know in the comments! What RSS Feeds AreĪn RSS feed is an XML document that WordPress publishes for you.Īn RSS feed is an XML document that WordPress publishes for you. How do you like the video, and the video/article combination? We might do this more if you find it helpful.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |