Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7578633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:28:48+00:00 2026-05-30T17:28:48+00:00

I am basically creating an iphone app that get’s it’s data from wordpress. WordPress

  • 0

I am basically creating an iphone app that get’s it’s data from wordpress. WordPress will serve audio and video links via a RSS feed to the iphone app. I have the feed and audio player working great but can’t seem to find anything related to how to create a custom feed where I can specify pagination like start=0&items=10. A plugin would be great but I can code something up in PHP if anyone has any ideas.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T17:28:49+00:00Added an answer on May 30, 2026 at 5:28 pm

    I’m going to answer this question by changing the standard RSS feed of a WordPress installation to respond to limits passed by query parameters. As you say you’ve already got a working feed, this should hopefully give you everything else you need.

    By default, the standard feeds in WordPress are limited by the setting “Syndication feeds show the most recent X items” on the Settings→Reading page, and are unpaginated, as that wouldn’t generally make sense for an RSS feed. This is controlled by WordPress’s WP_Query::get_posts() method, in query.php, if you’re interested in taking a look at how things work internally.

    However, although the feed query’s limit is set to LIMIT 0, X (where X is the above setting, 10 by default) , you can override the limit by filtering the query in the right place.

    For example, the filter post_limits will filter the LIMIT clause of the query between the point it’s set up by the default code for feeds and the time it’s run. So, the following code in a plugin — or even in your theme’s functions.php — will completely unlimit the items returned in your RSS feeds:

    function custom_rss_limits($limits) {
      if (is_feed()) {
        // If this is a feed, drop the LIMIT clause completely
        return "";
      } else {
        // It's not a feed; leave the normal LIMIT in place.
        return $limits;
      }
    }
    add_filter('post_limits', 'custom_rss_limits');
    

    (At this point I should mention the obvious security implications — if you’ve got 20,000 posts on your blog, you’ll cause yourself a lot of server load and bandwidth if if lots of people start grabbing your feed, and you send out all 20,000 items to everyone. Therefore, bear in mind that whatever you end up doing, you may still want to enforce some hard limits, in case someone figures out your feed endpoint can be asked for everything, say by analysing traffic from your iPhone app.)

    Now all we’ve got to do is to respond to query parameters. First of all, we register your two query parameters with WordPress:

    function rss_limit_queryvars( $qv ) {
      $qv[] = 'start';
      $qv[] = 'items';
      return $qv;
    }
    add_filter('query_vars', 'rss_limit_queryvars' );
    

    That allows us to pass in the start and items variables you’re suggesting for your URL parameters.

    All we have to do then is to adjust our original LIMIT changing function to respond to them:

    function custom_rss_limits($limits) {
      if (is_feed()) {
        global $wp_query;
        if (isset($wp_query->query_vars['start']) &&
            isset($wp_query->query_vars['items'])) {
            // We're a feed, and we got pagination parameters. Override our
            // standard limit.
    
            // First convert to ints in case anyone's put something hinky 
            // in the query string.
            $start = intval($wp_query->query_vars['start']); 
            $items = intval($wp_query->query_vars['items']);
            $limits = "LIMIT $start, $items";
        } else {
          // We weren't passed pagination parameters, so just
          // leave the default limits alone.
        }
      }
      return $limits;
    }
    add_filter('post_limits', 'custom_rss_limits');
    

    And there you go. Throw those last two blocks of code at WordPress, and you can now use a URL like this on any of your existing feeds:

    http://example.com/feed/?start=30&items=25
    

    For this example, you’ll get the normal RSS feed, but with 25 items starting from item number 30.

    …and if you don’t pass the query parameters, everything will work like normal.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an iphone/ipad app that basically reads XML documents and creates tableviews from
Basically, I am creating an XML file by taking the values from a column
Basically I need to insert a bunch of data to an Excel file. Creating
I am creating an iPhone app which I would like to have a similar
I am building an iPhone Utility app that uses UIImageView to display an animation.
I am basically creating an API in php, and one of the parameters that
I have been given a new task from the client which is basically creating
I am making an iPhone app. I am creating an image out of the
Hey, basically i'm on my second App for the iPhone SDK and im really
From my understanding the Adapter pattern is basically creating a wrapper on another class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.