• Resolved rafael777

    (@rafael777)


    Hi,

    I don’t see a way to fetch the posts that belong to a specific category ID. All I see is these options:

    Specifying the category names manually. This is no good because it won’t work if I change the name of the category),

    Choosing the current category. I find this works oddly, since it fetches the first category in the a-z alphabet, which isn’t helpful (it would’ve been better if it fetched the Primary Category instead).

    Am I missing something?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Aldo Latino

    (@aldolat)

    Hi,

    – Specifying the category names manually. This is no good because it won’t work if I change the name of the category),

    You can use the “Custom taxonomy query” panel, where you can use IDs, names, and slugs. For example:

    where:

    category is the taxonomy
    Term ID is the field you want to use
    7 is the ID of the category

    – Choosing the current category. I find this works oddly, since it fetches the first category in the a-z alphabet, which isn’t helpful (it would’ve been better if it fetched the Primary Category instead).

    I think you are referring to the same question posted here.

    When changing the query in single posts, you can choose which category is used by WordPress to get posts from by activating “Sort categories”, in the “Getting posts” > “Change the query when on single posts” > “Get posts from current category” panel.

    I wrote a post on this in my blog.

    Let me know, please.

    Plugin Author Aldo Latino

    (@aldolat)

    Hello,
    since some months have passed from last reply, I close the thread. Feel free to reopen it or start a new one.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get posts by category ID?’ is closed to new replies.