• Resolved shazam2018

    (@shazam2018)


    I tried to write client code to create sermon through REST API. I have few questions:

    1. How do I set Date Preached? And what is the format?
    2. If I don’t want to use featured media for image, can I use html img tag and put it in content like I usually do in WordPress Post?
    3. How can I query for all sermon through REST API?

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    1. The format for setting the date preached is an Unix timestamp integer, the key is “sermon_date”.
    2. Everything that works for posts will work the same for Sermons, so I don’t see why it wouldn’t work
    3. The same way as you would with posts: /wp-json/wp/v2/wpfc_sermon?per_page=100&page=1. Unfortunately, there’s a limit of 100 posts/sermons per page in the WordPress’ REST API itself, so unless you can access the source code of the website and alter the setting, you would need to create some function that would go through all pages

    Thank you for your patience.

    Thread Starter shazam2018

    (@shazam2018)

    Thanks Nikola. I able to set date preached.

    I tried to put something in content but that does not show up. I run the endpoint on the browser, there’s no content key.

    Hi, my apologies, I forgot to mention that. The sermon content goes into “sermon_description” meta field, just like “sermon_date”, except that the field type is string, of course.

    Thanks for the reply! 🙂

    Thread Starter shazam2018

    (@shazam2018)

    Thanks Nikola.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘REST API’ is closed to new replies.