Shortcodes / Blocks not working im nested page templates?
-
Hey there! I really am a big fan of Download Monitor, especially of the option to setup custom download button styles.
But, strangely, there is an issue that I ran into and I’m not sure how to solve it.
I’ll try to describe it:
My setup is a custom theme, based on a skeleton starter theme. So I have basic PHP knowledge.
I have two custom post types set up via CPT UI.
One is for the parent pages. The other other is for the child content, which contain the Download shortcodes (= Blocks).
I use classic PHP templates for both to load and structure all content.
I load the child-items into the parent page via classic wp query if($posts) … foreach($posts as $post) etc..When trying load the children (posts) in a query using the call $post->post_content; (for each..) the shortcode and also the block code <!– wp:download-monitor/download-button {“download_id”:7977} /–> won’t get rendered. Block code is commented out (I tried both – Blocks and Shortcode).
When using <?php the_content(); ?> in a second query, the display of the download buttons is correct, but the query always outputs just the first post multiple times. So, this seems to be my bad….
Question: what would be the correct php setup to call a child-page’s content?
Hope I could make my problem clear and you have a simple solution for it ??
Best regards and thank you for your help!
Stefan
- The topic ‘Shortcodes / Blocks not working im nested page templates?’ is closed to new replies.