Skip Navigation

[Resolved] Split: Using the wpv-post-title shortcode for the related post

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/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by Waqar 9 months, 3 weeks ago.

Assisted by: Waqar.

Author
Posts
#2681402

This worked great! Thanks. Do you know of a way to get the Post Title of the property to be the Email Subject?

When I put [wpv-post-title] as the Email Subject it uses the Post Title of the agent's page in the Email Subject, not the property he is connected to.

Is there a way to pull the property title, which is the Post Title on this page, and the property this agent is connected to thru a relationship, into that Email subject?

The ultimate goal is to have a function where people can contact the agent about the property they are viewing.

Thanks for your time.

#2681407

Hi,

To use the '[wpv-post-title]' shortcode for a related post, you can make use of the 'item' attribute, as explained here:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute

For example, suppose the 'Property' and 'Agent' post types are connected through a one-to-many relationship, where one property can be connected to multiple agents.
( Property is parent and Agent is child in the relationship with slug 'property-agent' )

To get the title of the related property, on the single agent post, the shortcode will be:


[wpv-post-title item='@property-agent.parent']

regards,
Waqar

#2681839

Hi Waqar,
I tried every type of relationship, @property-agent.parent, @property-agent.child, @property-agent.intermediary, and it never pulled the correct property of the post this agent is connected to. It pulled other properties into the email title, but not the one on the current post. Here is the URL of the page I am referring to: hidden link

If you click on the email link at the very bottom, for the agent who is connected to this property, I need "Immaculate Steakhouse With Real Estate" (the name of this property at the top of the page) in the title of the email.

PS- All the agents on the site are in a many to many relationship with the properties.

Thanks,
Mike

#2681843

I figured it out! I just use $current_page.

Thanks,Mike

#2681947

Thanks for the update and glad that you were able to make this work.

You're welcome to mark this ticket as resolved and start a new one for each new question or concern.