Skip Navigation

[Resolved] Displaying Post title of page view is displayed in

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

Problem:
How to display in a View the title of a page where the View is inserted?

Solution:
Add the item="$currentpage" attribute to the wpv-post-title shortcode in the View.

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

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

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by stephenW-4 5 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#1226936
PostTitle-1.jpg

Tell us what you are trying to do?

I've created a templating system where the user can choose from a selection of Header styles. The Headers are CPT's. In the headers layouts I want to display the Post Title, but can't figure out how to display the post title of the page the header CPT view is displayed in.

In the attached image I've highlighted the Header CPT selection. The header layout displays the {!{wpv-post-title}!} and returns the name of the header. I'm thinking I to replace {!{wpv-post-title}! with a view which returns the Post title of parent page or URL Id but can't figure out how to go about this.

Any help would be appreciated.

best regards

Stephen

#1226977

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Stephen

You can add an item attribute to your Views shortcodes, e.g.

[wpv-post-title item="$currentpage"]

will output the title of the page regardless of where it is inserted.

(In your case you are using a page-builder and should continue with the {!{ }!} format for shortcodes.)

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

#1227005

Ahha even easier than I thought - my issue is resolved now. Thank you!