![]() Once you have the custom Page Template uploaded to your server, log into the WordPress Admin and visit the “Add New Page” screen ( Pages > Add New). Step 2: Create the custom Page in the WP Admin For a full list of options, check out query_posts at the WordPress Codex. You can exclude/include categories, display specific types of posts, change the number of posts displayed, and so much more. The query_posts function is quite flexible and provides all of the parameters needed to set up just about any customized feed content. So for example, if we post articles in three different categories, say with IDs of 1, 2, and 3, we would modify our code to look like this: $numposts = 10 // number of posts in feed This is where you customize your new feed to include whatever you want. And with $more set to 1, the full article will be included in the feed. Using this default code, the custom feed will show 10 posts from category 3. $posts = query_posts('showposts='.$numposts.'&cat=3') In the first few lines of code, we specify how many posts to display, which categories to include, and whether to display full posts or excerpts: $numposts = 10 // number of posts in feed This is basically just a typical WordPress feed template, but with some extra query action to make it do what we want. " rel="self" type="application/rss+xml" /> ![]() Then add the following code (don’t worry it’s actually not that bad): ' Go to your theme directory and create a new PHP file named article-feed.php. It’s pretty easy to do, requiring a whopping two steps to make it happen. The technique is actually pretty flexible, and works great to create just about any type of custom WordPress feed content. ![]() In this post, we create a custom, “articles-only” feed for visitors who want to subscribe to the main content only, without all the side stuff. Update! Check out more feed customizing tricks & tips: Customizing WordPress Feeds, Easy Custom Feeds in WordPress, and What is My WordPress Feed URL?.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |