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.
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.
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.
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.
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.
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"]']
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).
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.
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