List a category with web links (Post Category URLs)

Goal

Add a button to your app that lists the posts in a chosen WordPress category, with each row carrying the post’s web URL alongside its in-app content. This is the Post Category URLs content type (WordPress Post Category URLs). Reach for it when you want a category list whose items can open the original web page — articles, press releases, or sponsor pages that should round-trip back to your website, for example.

If all you need is an in-app reading experience — the post body rendered natively, no web link — use WP Post Category instead. See Content class: WP Post Category.


Before you start

  • Admin access to Mobile App Manager.
  • At least one WordPress category with published posts in it. The category dropdown is populated from your live categories (get_categories()).
  • A decision about which category to list. This content type binds the button to one category that you pick at configuration time.

What this content type produces

For each post in the selected category, the app receives a row containing:

  • url — the post’s permalink with a from_app=1 query argument appended. This is the web link that gives the content type its name, and the app can open it in a webview or hand it off to the system browser.
  • title, content, author, and post_modified (formatted date).
  • subcategories — the names of every category the post belongs to, plus optional subcat_info (category image, name, and id) when category icons are available.
  • image / imageurl — the post’s featured image, with width/height for png/jpg/jpeg. No featured image on a post? The app falls back to the global placeholder image (see Placeholder image below).

These are fixed defaults, not settings you tune per button: the list comes back as a page of 30 posts, newest first, and only published posts make the cut (post_type = post, post_status = publish). There’s no per-button control over pagination, order, or post type.


Steps

1. Open the Buttons admin

Go to Mobile App Manager → Buttons to see every button configured for the currently selected role. The role dropdown at the top switches roles, since buttons can have per-role variants.

2. Add the button

Click Add a Button. From the content-type dropdown choose Post Category URLs (shown as WordPress Post Category URLs). Give the button a display title.

3. Pick the category

On the button’s content form, use the Select WordPress Post Category… dropdown to choose the one category whose posts this button will list. The dropdown is sorted alphabetically by category name. Long names get truncated for display, but the full name is preserved underneath.

This is how the button knows what to show: every row in the app will be a post from the category you pick here, each one carrying that post’s web URL.

4. (Optional) Set the placeholder image

Posts without a featured image fall back to a global placeholder image rather than rendering blank. See Placeholder image below to set it once — it covers every Post Category URLs list you build.

5. Place the button

A button isn’t shown until it’s placed on a surface:

  • Home screen: Mobile App Manager → Layout — drag the button into a layout section.
  • Left menu: Mobile App Manager → Navigation → Left Menu.
  • Tab bar: Mobile App Manager → Navigation → Tab Bar (up to 5 tabs).

See Recipe: Add a button for the full placement walkthrough.

6. Verify in the Previewer

Now see it live. Open the Previewer, switch to the role you set up, and tap your way to the button. You should see the category’s posts listed out — and because each row carries its web URL, tapping one should surface the post and link out to (or open in a webview) the original web page.


Placeholder image

When a post in the list has no featured image, the app uses a global fallback image stored in the option tsl-setting-post_cat_url_placeholder. The fallback only kicks in when this option holds a non-trivial value — more than one character. Leave it empty, and posts without a featured image simply show no image at all.

This option is global: one setting, shared by every Post Category URLs button, rather than something you configure per button. Whenever tsl-setting-post_cat_url_placeholder holds a value longer than one character, that value becomes the fallback image for any post missing a featured image.


When to use this vs. WP Post Category

You want… Use
A native in-app list + detail reading experience WP Post Category
A category list where each row links to the post’s web page Post Category URLs (this article)

Gotchas

  • One category per button. Need several categories covered? Add a button for each one (or use a different content type).
  • from_app=1 is intentional. Every web URL handed to the app carries from_app=1, so your website can spot app traffic and adjust the page accordingly — stripping the theme chrome, say. Keep this parameter intact when you wire up the link target; stripping it breaks that detection.
  • Empty categories are skipped during seeding. When the setup wizard auto-creates category buttons, it passes over any category with no published posts, along with the uncategorized category.
  • Web content shows your site’s HTML. Because rows can open the live web page, double-check that those pages render well inside a mobile webview.

Verification

  • The button appears in Mobile App Manager → Buttons for the configured role.
  • The selected category is shown in the content form’s category dropdown.
  • In the Previewer, the list shows that category’s published posts.
  • Tapping a row opens the post’s web page / webview using its url.
  • Posts without a featured image show the configured placeholder (if set).

Category images (no code)

Each category can carry its own image, and the app surfaces it in the row’s subcat_info (category image, name, and id) — no code, no app rebuild.

  1. Install and activate the Categories Images plugin (wp.org slug categories-images), available from the WPMAM → Software menu or under Plugins → Add New.
  2. Under Posts → Categories, edit a category and set its image in the plugin’s Image field.
  3. Publish your app content, and the image flows into each post’s category info on its own.

Fallback order. A host theme or plugin category icon (a Templatic theme icon, for example) takes priority. The Categories Images image only steps in when the host doesn’t supply one, and enabling the plugin never overrides an icon that’s already set elsewhere.

  • Recipe: Add a button
  • Content class: WP Post Category
  • Content classes overview
  • App setting: Post Category URL placeholder
Was this article helpful?
Contents

    Need Support?

    Can't find the answer you're looking for? Don't worry we're here to help!