Troubleshoot: Alternative Dynamic Post Content Methods

THE USE CASE EXAMPLE :slightly_smiling_face:

For this site, I’m using a modal window linked up to some looper magic to pull in posts. Here’s the flow I want to retain:
image
(Above Image: Default State)
image
(Above Image: Hover State with correct post title)


(Above Image: Modal overlay showing successful post content pull)


THE PROBLEM :sob:

The title, link, etc. are all simply “dynamic content”, however… I have an ongoing problem I’m hoping you’ll know the answer to.

I want to bring the entirety of the post body content in to this modal dynamically, including the Gutenberg formatting (not the excerpt, and ideally sans ACF). There is a plugin that does this well, called Display Posts, which creates a shortcode that allows me to insert the post’s numeric ID to control using {{dc:post:id}}.

When this plugin is active AND used on an item with dynamic content, it breaks other dynamic elements. In this case, it’s the modal toggle’s post title pull, which then decides to use the actual nesting page’s name. Note that it pulls the featured image background in just fine still (which is the container BG).

image
(Above, weirdly-justified image: Broken dynamic title on Hover State)


THE ASK / BOTTOM LINE :raised_hands:

I’m not expecting your team to troubleshoot out a problem clearly caused by a 3rd party plugin, but rather I wanted to illustrate my use case clearly—the ideal “fix” is that you might know a Cornerstone-based solution or workaround that lets me not use ANY plugin, nor jump into custom shortcode building/registration in functions.php, yet still pull in post content dynamically.

It’s a long shot, but I figured it’s worth the ask.

Thanks! :grinning:
-Jake

Hi @Rule72,

Thanks for reaching out!

I am not quite sure what’s going on in your homepage setup but when I tried to create a test page, the setup is just working fine. ( See the secure note for the link of the test page )

On the other hand, to show the content text without using any 3rd party plugins, I suggest that you check this thread ( I am referring to instruction number 5 )

Hope that helps.

1 Like

Thanks for the quickness!

The test setup you have is accurately pulling in titles, and is something I have also been able to achieve on my end with no problems! The issue is when introducing that 3rd party plugin, which I ONLY use to pull in the pure, simple post content from this area:

It’s my understanding that this particular section is one of the few (if maybe ONLY) “no-touchy” elements in regards to loopers, is that correct?


Assuming my understanding is correct… ACF relational fields are interesting. Give me a day or two to catch myself up on their documentation before closing this, if you may!

I rescind the previous deal; registering a new shortcode myself rather than relying on a plugin was something I had wanted to look at, but I hadn’t done any post-based shortcodes since pre-Gutenberg.

I was concerned that there would be extra considerations to rendering (because, Gutenberg), but the snippet you pointed out works nicely and kills whatever problems that plugin introduced. For topic completeness, here’s the registration code:

function get_data() {
	the_content();
}
add_shortcode('custom_content', 'get_data');

This problem is a wrap, thanks!

Hi @Rule72,

You’re welcome and we’re glad that it is now working on your end! If you have any other concerns or clarifications regarding our theme features, feel free to open up a new thread.

Thank you.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.