• Resolved Clayton Chase

    (@claytonchase)


    Fantastic plugin so far! I had a question about sorting by specific post categories only.

    I’m using this plugin as an A-Z Conditions table but only want to show post with specific categories so they can be organized by condition. Is that currently possible?

    Thanks,
    Clayton

    • This topic was modified 6 years, 11 months ago by Clayton Chase.

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Dani Llewellyn

    (@diddledani)

    You can filter the results by term using a shortcode similar to:

    [a-z-listing post-type="post" taxonomy="category" terms="condition-yellow"]
    


    Random aside:
    A: Go to yellow alert.
    B: But, sir, do we have to?
    A: Yes, just do it.
    B: But it means changing the bulb!

    Plugin Author Dani Llewellyn

    (@diddledani)

    There will be a fix landing shortly for using multiple terms in the terms attribute. Currently it’s broken, but soon it won’t be.

    Thread Starter Clayton Chase

    (@claytonchase)

    Thanks for responding!

    I’m not too familiar with what a term in WordPress is. I’d like to show only certain categories. I’ll hopefully be using this for a conditions table. So if I can apply a certain category to a post (for example Antibiotics) then I can load all the specific categories I want to be displayed in the table. Here is the page which might help: https://dogsnatu.staging.wpengine.com/dev/

    I read up on terms but still don’t understand how those work.

    Plugin Author Dani Llewellyn

    (@diddledani)

    My simple guide taxonomies and terms:

    • A Taxonomy is a group of Terms
    • A Term is a single thing that is used as a classifier by assigning it to one or more posts
    • “Categories” and “Tags” are examples of taxonomies. These are included by default in WordPress.
    • A single “category” or “tag” is an example of a term. These are placed into the taxonomy “categories” or “tags” respectively.
    • For example, say you’re showing pictures of Dogs, you could have a separate taxonomy called “Dog breeds” which has a term for each “Breed” of dog. These could then be used to classify the photos so that people can find all the dogs of a specific breed.

    If you’re using the “Categories” taxonomy for your condition types then you want to use the example I originally gave, where you replace “condition-yellow” with the “slug” of each “Term” (Category) you want to display, separated by commas. The slug is shown on the “Term edit page” (Admin -> Posts -> Categories [or other taxonomy name] -> <click on a category>).

    Thread Starter Clayton Chase

    (@claytonchase)

    Okay, that makes sense. Thanks for the in-depth reply. So I’d like to sort by tag. I’m getting this error with this shortcode: [a-z-listing post-type=”post” taxonomy=”tag” display=”terms” terms=”good, paris”]

    Here is a screenshot of the error: https://imgur.com/a/Wbw4JVV
    https://dev.kaolincreative.com/dev/

    I’m sure I’m just missing something simple.
    Thanks!

    Thread Starter Clayton Chase

    (@claytonchase)

    Alright, so I figured out I wasn’t using the right term slug so I got that fixed. Is it possible to only display the terms I specify in the shortcode? This is my shortcode: [a-z-listing post-type=”post” taxonomy=”post_tag” display=”terms” terms=”good,paris”] – I’d like to only show the “good” and “paris” tags but instead I am getting all the post tags.

    I hope that makes sense.
    URL: https://dev.kaolincreative.com/dev/#letter-W

    Thanks for the help!

    Thread Starter Clayton Chase

    (@claytonchase)

    Haven’t heard anything back and just wanted to see if anyone has had luck doing this?

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    It looks like you’re using conflicting parameters. display=terms will show the terms themselves, not the posts associated with those terms. It isn’t possible to limit the terms displayed in this mode, which you’re attempting to do with terms="good, paris".

    Thread Starter Clayton Chase

    (@claytonchase)

    So if I want to show the name
    Of the terms I select I just remove the display=terms and then I can list the terms via the terms= parameters?

    Plugin Author Dani Llewellyn

    (@diddledani)

    No, You can only show all the terms from a taxonomy, or all posts associated with specific terms. You can’t filter the list of terms displayed when you’re showing term names instead of posts.

    You can choose between:

    • Display All Term names from a specific taxonomy
    • Display Post names
    • Optionally: filter by specific terms
    Thread Starter Clayton Chase

    (@claytonchase)

    I see. Darn it. I know it’s pretty unusual to use this plugin like this but it’s the best I’ve been able to find. Any other suggestions?

    Thread Starter Clayton Chase

    (@claytonchase)

    I figured it out. Custom taxonomy ?? Thanks for the info and for developing such a solid plugin!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Load Posts Only Under Certain Categories’ is closed to new replies.