How to set up an RSS or MailChimp feed with IssueM

If you want to allow your readers to easily keep up-to-date with your latest articles then you are going to want to make use of RSS feeds, whether it’s simply providing a feed for adding to a reader or creating an RSS-driven campaign in MailChimp.

Finding the feeds for articles can be a little tricky though, so here’s what you need to know.

RSS feed of most recent articles

http://yourdomain/feed?post_type=article

This will list the most recently published articles by publish date1, regardless of issue.

RSS feed of most recent articles in a particular article category

http://yourdomain/article-categories/[category-slug]/feed

This will the most recently published articles for a particular category by publish date. The easiest way to get the URL is to go to Articles > Article Categories, hover over the category name and click View on the action menu. This will take you to the article category listing on the public site and all you need to do is add /feed to the URL in your browser’s location bar.

If you are using WordPress categories for your articles, then you can use the same technique but go to Posts > Categories instead. Remember, this will include posts as well as articles, so if you only want to include articles add /?post_type=article to the end of the URL.

Adding articles to your main RSS feed

Your site’s primary RSS feed (http://yourdomain/feed) will only include posts. If you want to include articles in the feed as well then you need to let WordPress know.

You can do this by adding the following code to the bottom of your theme’s functions.php file2:

<br>// Add articles to main RSS feed.<br>function add_articles_to_main_feed( $query ) {<br>if ( $query->is_feed() && !isset( $query->query['post_type'] ) )<br>$query->set( 'post_type', array( 'post', 'article' ) );<br>return $query;<br>}<br>add_action( 'pre_get_posts', 'add_articles_to_main_feed' );

Providing an RSS feed for the current issue

Providing an RSS for a specific issue is easily achieved via the following URL:

<code>http://yourdomain/feed/?taxonomy=issuem_issue&term=[issue-slug]

However, that is pretty limited and a more likely scenario is that you’ll want to provide a feed for the latest issue without having to know the slug. Good news, we can do that!

Add this code to the bottom of your theme’s <em>functions.php</em>2 file:

<code><br>// Add current issue feed<br>function add_current_issue_feed( $request ) {<br>if ( isset( $request['taxonomy'] ) && $request['taxonomy'] == 'issuem_issue'<br>&& isset( $request['term'] ) && $request['term'] == 'current' ) {<br>$request['term'] = get_issuem_issue_slug();<br>}<br>return $request;<br>}<br>add_action( 'request' , 'add_current_issue_feed');

<code>What this function does is intercept the page request and check if it contains <em>taxonomy=issuem_issue&term=current</em>. If it does, then it replaces current with the latest issue’s slug.

<code>In affect, this creates one of those specific issue requests on the fly.

<code>The latest issue RSS feed URL looks like this:

<code><code>http://yourdomain/feed/?taxonomy=issuem_issue&term=current

<code><em>Notes:</em>

    <code> <li>The number of items (posts or articles) in a feed is controlled by the Syndication feeds show the most recent option in <em>Settings</em> > <em>Reading</em></li><li>Whilst you can edit your theme’s functions.php file, any changes will be lost if the theme is updated. The preferred method to add functionality to a theme is to <a href="https://codex.wordpress.org/Child_Themes">create a child theme</a>.</li>

Still need help? Contact Us Contact Us