Skip Navigation

[Resolved] Same View Displaying Different Values Depending of Page where it is inserted

This thread is resolved. Here is a description of the problem and solution.

Problem:

Outputs the ID for the current post.

Solution:

You can try to modify it as current post ID shortcode, for example:
[wpv-post-id]

Relevant Documentation:

https://wp-types.com/documentation/user-guides/views-shortcodes/#wpv-post-id

This support ticket is created 5 years, 6 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Furlan 5 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1271231
2019-06-17_22-02-45.png
2019-06-17_22-03-24.png

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.

#1271287

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.

#1271677

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.

#1271951

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.