Skip Navigation

[Resolved] Referencing a CPT in another Post Type

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

Problem: I would like to show post summaries within other post contents, like when I insert a link in a Facebook post. A summary of the link's contents is attached to the post and I can see the post title, image, and excerpt.

Solution: There's not an automatic feature to do this, you would have to create a View that is filtered by post ID and insert that View manually using the post ID of the link.

Relevant Documentation:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/

This support ticket is created 6 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 6 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#1069334

Tell us what you are trying to do?
I am creating a CPT for Gods/Goddesses. I want to reference a God/Goddess in a Blog Post or on a Web Page in WordPress. How do I get a "blurb" to display about that God/Goddess inside of the Blog Post or Web Page like it does on Facebook when I reference a Blog Post or a Web Page and the Favorite Image pops up and an excerpt is displayed?

Is there any documentation that you are following?
I've looked and cannot find anything.

Is there a similar example that we can see?
When you post a link to your WordPress content on Facebook it looks like:
hidden link

I want to have the same thing happen when I post a link to something on MY site FROM MY site.

What is the link to your site?
churchofthepaddedwall.org

#1069560
Screen Shot 2018-07-31 at 6.05.32 PM.png

There's not an automated way to do this in Toolset or WordPress, but you could use Views to do something similar with a shortcode and the post ID. The process is manual in that you must insert a shortcode using the desired post's ID. Here's how that could work:
- Create a View that displays posts of any post type, and add a Query Filter to filter by post ID where the post ID is set by a shortcode attribute "ids" (see the screenshot).
- In the Loop Output of this View, add the post title or post link shortcode, the featured image shortcode, an excerpt shortcode, a post date shortcode...any other information you want to display in the blurb.
- Insert this View shortcode in your Blog post using the Fields and Views button wherever you want to show a blurb, and insert the post ID in the shortcode filter attribute "ids":

[wpv-view name="your-view-slug" ids="12345"]

Replace 12345 with the numeric ID of the post you want to display in the blurb.