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 9208157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:33:23+00:00 2026-06-18T00:33:23+00:00

I’ve been toying with the WordPress JSON API today and I made a JQuery

  • 0

I’ve been toying with the WordPress JSON API today and I made a JQuery Mobile application that displays posts from my WordPress blog. The query I do is this one ?json=1&callback=cb and it gets me 10 posts. The only problem is: what if someone wants to see the 11th post? I haven’t found any way to get it.

  • I could set a count to 20 in my query but it’d only transfer the problem to the 21st post.
  • Increasing the count every time the user reaches the limit would mean that all already seen posts (the 10 first) are downloaded again, for nothing.

I don’t feel good about any of these solutions. I’ve seen you can search a post by:

  • its slug: I don’t know it.
  • date: I know it is older than that of the post I am currently displaying, but the query needs the real date and I don’t have it.
  • category, author: doesn’t help finding that 11th post.

Here’s my code to give you an idea.

HTML:

    <div data-role="header">
        <a href="#" data-role="button" data-theme="a" onclick="loadPictureFromId(currentPictureId+1)">Previous</a>
        <h1 id="title"></h1>
        <a href="#" data-role="button" data-theme="a" onclick="loadPictureFromId(currentPictureId-1)">Next</a>          
    </div>

JS:

    var currentPictureId;
    var myData;

    function cb(data) {
        myData = data;
        loadPicture(0);
    }

    function loadPictureFromId(id) {
        if (id<0) {
            alert("There are no more pictures!");
        }
        else
        {

            if (id>9) {
                alert("Feature not supported yet.");
            }

            else
            {
                currentPictureId = id;
                var temp = $("<div/>").html(myData['posts'][id].title).text(); // HTML entities
                $("#title").text(temp);
                document.title = temp;
                $("#img").attr({'src': myData['posts'][id].attachments[0].url, 'alt': temp, 'title': temp});    
                $("#facebook").attr({'data-href': myData['posts'][id].url});    

            }
        }
    }

</script>
  • 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-06-18T00:33:24+00:00Added an answer on June 18, 2026 at 12:33 am

    If this is the plugin you are using:
    http://wordpress.org/extend/plugins/json-api/

    Then the parameter you are looking for is page . If you set page to 2 in your request it will get posts 11 to 20. E.g. ?json=1&page=2&callback=cb

    The README details this.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
I am using jsonparser to parse data and images obtained from json response. When
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am confused How to use looping for Json response Array in another Array.
I am using JSon response to parse title,date content and thumbnail images and place
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace

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.