Skip Navigation

[Resolved] Post id and Post title for the post calling view

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

Problem:

Display post title of current page/post.

Solution:

Please try item='$current_page' attribute in Types/Views shortcodes, for example:

[wpv-post-title item='$current_page']

Relevant Documentation:

https://toolset.com/documentation/user-guides/views/views-shortcodes/item-attribute/

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 – 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 2 replies, has 2 voices.

Last updated by sandeepc 4 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#1583643

We have a custom post type " ideas"
The idea post call a view .
This view populate multiple post from the post type "post"
We are not using any parent child relationship between "ideas" and "post" post types.
Inside this view we want show the Post id and Post title of the post (post type "ideas" ) calling the view

i am using this shortcode
[wpv-post-title id='[wpv-post-id]']

But both will show the details of the post type post
We can populate this , if we can get the post id of the post type "ideas" .
please guide me how we can get the post id of the post type "ideas"

#1583801

Hello,

I assume we are talking about this:
In a single "ideas" post, there is a post view, which is querying posts.

You are going to display current "ideas" post ID in above post view.

If it is, please try item='$current_page' attribute in Types/Views shortcodes, for example:
[wpv-post-title item='$current_page']

See our document:
https://toolset.com/documentation/user-guides/views/views-shortcodes/item-attribute/
$current_page is used to retrieve data from the current page being rendered. It can be used inside a View loop to obtain data from the page on which the View is being rendered.

#1583803

Sir, Thank you for the help and guidance .