Hi,
Same View Displaying Different Values for the Same Post Depending of Page or Other View where it is inserted.
The view was prepared according the instructions of Cristian Cox in a previous ticket: https://toolset.com/forums/topic/displaying-checked-and-unchecked-taxonomies-for-a-specific-post-in-a-view/
The Views
The following is hierarchically how the views are used:
- 'Escort List View with Pagination'
- 'All Social Activities I love to Do View'
- 'Ad Term Glyph to Social Activities').
- 'First 5 Dos and Don'ts Social'
- 'All Social Activities I love to Do View'
- 'Ad Term Glyph to Social Activities')
The Pages
The previous main views ('Escort List View with Pagination' and 'First 5 Dos and Don'ts Social') are present into 2 different pages respectively: (They work fine in 1 of them, and didn't in the other)
- hidden link Displays Wrong
- hidden link Displays Fine
Note that the common factor are the views:
- 'All Social Activities I love to Do View'
- 'Ad Term Glyph to Social Activities')
I have spent several hours trying to figure the reason of this behavior, I will appreciate your help to solve this issue.
Hello,
I assume we are talking about this case:
- Custom post type "anuncio"
- Custom taxonomy "Sports", and is registered to above post type
The problem page you mentioned above:
hidden link
It seems to be a wordpress page, and it is displaying multiple "anuncio" posts, but there isn't taxonomy "Sports" in that page.
So the shortcode [wpv-post-id id='$current_page'] won't work as expected, it will output current page ID, you can try to modify it as current post ID shortcode, for example:
[wpv-post-id]
More help:
hidden link
Outputs the ID for the current post
https://toolset.com/documentation/user-guides/views-shortcodes/item-attribute/
Item Attribute.
Hi Lou,
Thank you for your reply.
I think you are right, I am passing the bad argument.
[wpv-view name="Ad Term Glyph to Social Activities" ids="[wpv-post-id id='$current_page']" terms="[wpv-taxonomy-slug]"]
What I need maybe is to pass the current post id argument to 'Ad Term Glyph to Social Activities' (instead of $current_page). I review the link you sent, but is not totally clear how to do it.
Hi,
As Luo mentioned the shortcode [wpv-post-id id='$current_page'] wasn't working as expected. I modified the code as follows (removing id='$current_page'):
Before:
[wpv-view name="Ad Term Glyph to Social Activities" ids="[wpv-post-id id='$current_page']" terms="[wpv-taxonomy-slug]"]
Now:
[wpv-view name="Ad Term Glyph to Social Activities" ids="[wpv-post-id]" terms="[wpv-taxonomy-slug]"]
Now is working smoothly.