• Resolved anneonsightpa

    (@anneonsightpa)


    Tag param seems not to be working. When I use the shortcode:

    [display-posts post_type=”project” image_size=”thumbnail” include_date=”true” date_format=”F j, Y” category_display=”true” tag=”bicycles”]

    Nothing is output, even though I’ve confirmed I have at least one project with the tag slug “bicycles”. I’ve tried with several other tags, too — just outputs nothing.

    I know the params are working generally, because if I try:

    [display-posts post_type=”project” image_size=”thumbnail” include_date=”true” date_format=”F j, Y” category_display=”true” meta_key=”topic” meta_value=”bicycles”]

    It does return a post where I’ve entered a new custom field for Topic/Bicycles — just need to hand this over to some non-technical users and hoping the tags param can work!

    Other issue: in neither case is it displaying the categories for the post, even tho I have “category_display” set to true. Not as a big a deal, but is there a resolution for that?

    Thanks!

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    Are you sure the the post_tag taxonomy is registered on your project post type?

    My guess is you have a separate Project Tags taxonomy used by that post type. Go to the backend and edit the “bicycles” tag. Look at the URL and see what the taxonomy is called (example: https://cl.ly/32855633b58c ).

    The category parameter only applies to the category taxonomy, and the tag parameter only applies to the post_tag taxonomy.

    If you have a custom taxonomy named project_tag, you’ll need to do a taxonomy query like this:

    [display-posts post_type="project" taxonomy="project_tag" tax_term="bicycles"]

    In your second example you show a meta query for bicycles and it works. Are you setting both a tag and post meta to “bicycles” when you edit a project?

    The category_display parameter uses the “category” taxonomy by default, but you can specify an alternative taxonomy. If you wanted to list the terms in the project_tag taxonomy, use:

    [display-posts post_type=”project” category_display=”project_tag”]

    Thread Starter anneonsightpa

    (@anneonsightpa)

    Brilliant, that worked — the project tags and project categories were in a different taxonomy, of course. So category_display=”project_category” worked where category_display=”true” did not; likewise taxonomy=”project_tag” tax_term=”bicycles” worked where tag=”bicycles” did not.

    (I was only use the custom meta to trouble shoot, wasn’t really necessary for my example except that it demonstrated to me that overall the plugin filtering was working, just not using tags).

    That answered my question, thank you for such a simple and speedy response.

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

The topic ‘Tag param not working’ is closed to new replies.