|
Display post inside another post filtered by field value
Started by: rusty
in: Toolset Professional Support
Quick solution available
Problem:
I created a post type called "Stores" that displays store info and a Google map for each store. I created a second post type called "Upcoming Events" that shows event information and date of each event. I would like to display Upcoming Events for each store based on the value of a field (Store Number) from the Store post type. The store number is part of the information entered for each store, it is not the post ID. I would like to be able to create an Upcoming Event and enter a comma separated list of Store Numbers in order to display the event on one or more store pages.
Solution:
In your case, one "Upcoming Event" post can connect to multiple "Stores" posts, and one "Stores" post can connect to multiple "Upcoming Event" posts, that is many-to-many relationship,
I suggest you follow our document to setup many-to-many relationship between post type "Upcoming Event" and "Stores", within many-to-many relationship, it is not required to re-entering the same Upcoming Event info for each store location.
Relevant Documentation:
Creating and Displaying Many-to-Many Post Relationships
https://toolset.com/documentation/user-guides/many-to-many-post-relationship/
|
|
2 |
4 |
7 years ago
Luo Yang
|
|
Creating related view– showing post as related to itself
Started by: Kacey
in: Toolset Professional Support
Quick solution available
Problem: I have a View that lists posts. I have two Query Filters applied to the View:
- Taxonomy filter, set by the current post
- Post ID filter, set to include only posts passed in to the View using a shortcode attribute "ids"
However, the current post always appears in the results. I would like to show only other posts in this View.
Solution:
Modify the post ID filter to exclude posts by ID, and pass the current post's ID into the View using the shortcode attribute "ids":
<div class="col-sm-8">[wpv-view name="related-posts-for-featured-view" ids="[wpv-post-id]"]</div>
Relevant Documentation: https://toolset.com/documentation/user-guides/passing-arguments-to-views/
|
|
2 |
5 |
7 years ago
Kacey
|
|
I need help displaying child posts by category and subcategory on parent post.
Started by: milesE
in: Toolset Professional Support
Quick solution available
|
|
3 |
5 |
7 years ago
milesE
|
|
Alphabetically sorting parents in many-to-many relationship views
Started by: TJS3586
in: Toolset Professional Support
Quick solution available
Problem:
I have a many-to-many relationship setup on my site.
Faculty (parent) --> Research Projects (Child) <--- Portfolio (Parent)
What I need this view to do is show me Faculty that share a child Research Project with the Portfolio item. It does this! BUT I need to to display alphabetically by post title of the Faculty post, not the Research Project.
Solution:
There isn't such a built-in feature within Views plugin, Views is using WordPress class WP_Query to query posts, your view is querying the posts of child post type "Research Projects", it can only order the results by fields of child post type "Research Projects", it is not possible to order the results by it's parent "Faculty" posts.
Relevant Documentation:
https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
|
|
2 |
3 |
7 years, 1 month ago
TJS3586
|