Skip Navigation

[Resolved] Trying to add taxonomy image to custom archive using Blocks

This support ticket is created 4 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 11 replies, has 2 voices.

Last updated by Shane 4 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#1638797

2 questions:
1) With help form a previous support ticket, I created a view that shows the custom taxonomy's image filtered by the current post. Now, I'm trying to add this view into a custom archive for this post type. When I add the view in the block editor and try to select the taxonomy view, it doesn't appear in the list. Why is this happening?

I've attached an image.

2) As suggested by Toolset, I'm using the OceanWP theme which includes Elementor. How can I display this archive in a post? I see in Elementor it can be done by inserting a view but since I'm using Blocks, this doesn't seem to be available.

#1639067

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2020-05-26 at 3.43.21 PM.png

Hi Moses,

Thank you for getting in touch.

I add the view in the block editor and try to select the taxonomy view, it doesn't appear in the list. Why is this happening?

Right now you are not able to use the View block to add the taxonomy view to you archive. What you will need to do is to use the Field and Text block and then use the Field and views button to add your view. See Screenshot

How can I display this archive in a post?

You want to display your custom archive on a post ?

If so then that is not possible to do you will need to use a regular view and create it to mimic your archive's design. With Toolset you're not able to add archives to your posts.

Please let me know if this helps.
Thanks,
Shane

#1639285

Yes, that does help. Thank you very much.

I've just created a regular view to mimic my archive's design, as you suggested. Now, I'm able to add this view in a post.

In this post, I plan to add tags. Is there a way to pass these tags (or even a post category) as a query parameter to the view that's contained in this post? This view has a query filter on taxonomy.

The reason for doing this is that eventually, I'd like to build a page with dropdown selections to allow the user to filter a group of posts and only those posts containing the tag or post category will show. I'm using this method because the content is not consistent.. some can fit into my custom post type, some are just plain posts.

Not sure if I'm being clear.

#1640107

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Moses,

For clarity you want to use the same view to filter the Tags that will be on the post as well ?

I would recommend using a separate view for this as you will have more precise control over the tags.

An example of this is that you may have a set of custom fields on the Categories but not on the tags, so where the tags are supposed to display these fields you will get an empty space.

Please let me know if this is clear.

Thanks,
Shane

#1640607

No, I'll use a separate view for filtering but these filters will be passed to another view that displays the results.

I'm not sure about using custom fields in categories because I want all of these posts to belong to the same category. That's why I was thinking of using tags but I'm not sure how to pass these tags from a post to a query that's contained in a view.

#1642149

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Moses,

So you want to have a view that is listing out the tags of the posts that it is attached to?

Or do you want to pass the tags of the current post into the view to display additional information on this tag?

Thanks,
Shane

#1642191

I want to pass the tags of the current post into the view.

#1642233

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Moses,

What you can do is to add your query filter to your view and set that filter to get its values from the shortcode attribute.

You can use this shortcode below to get your post tags https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-post-taxonomy

An example of what this would look like is.
[wpv-view name='my-view' param='[wpv-post-taxonomy type="category" separator=", " format="link" show="name" order="asc"]']

Please let me know if this helps.

Thanks,
Shane

#1645745

Where do I put this shortcode? I tried putting it in the Query Filter but it only allows lowercase letters and numbers.

So rather than using tags, I've decided to do the following:

1. Enabled my custom taxonomy on Posts.
2. Selected the appropriate taxonomy value on some Posts
3. Create a page in Elementor that shows a list of Posts. One of the posts will be the post I created above (Reply # 1639285) which contains the view that mimic the custom post type archive view. In this post, I've assigned it a custom taxonomy value.
4. Now, in the query filter section of this view, I've set the taxonomy filter to "Set by the page where this view is shown" because I want it to take the taxonomy I assigned to the Post I created in 3 (Reply 1639285).
5. Now, on this Elementor page, it only shows "No items found". For some reason, the taxonomy is not being passed to the view.

To summarize, this is how the page, post, and view are structured:

(a)Elementor page with a list of posts -> (b)Post containing a Layout with taxonomy value assigned ->(c) Layout contains the View - > (d)View mimicking custom post type archive (contains a taxonomy filter)

So, I want the taxonomy value in (b) passed to the taxonomy filter in (d) so that this view will display this "archive" in (a). I think my problem is I don't have the taxonomy filter configured correctly in (d).

I hope that's clear. I know it's a bit confusing.

#1646621

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Moses,

What i'm still unsure of is what should you view that is being filtered by the Post's taxonomy should display.

Is this view that is being used to display another set of taxonomies or related posts?

Perhaps if I know what this view is suppose to be displaying then I can understand the issue better.

Thanks,
Shane

#1646853

This view is supposed to display a list of a custom post type. I originally wanted to embed an archive of this custom post type using Blocks but I wasn't able to so I made a view to mimic it.

#1646967

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2020-06-01 at 3.25.04 PM.png

Hi Moses,

So essentially you want to display a list of posts that are related to the current post being shown.

In that case you will need to add a Taxonomy filter to your view and set it to get the current taxonomy from the page being viewed.

This way your view will automatically pick up the taxonomies of the current post and filter your view to only display the posts with similar taxonomies to the current page. See my screenshot

Please let me know if this helps.

Thanks,
Shane