• Hi Team,

    As always, you have done a great job with GenerateBlocks.

    I have a query.

    How can we output the parent post title with the link in the query block?

    {{loop_item key:post_parent}}

    Currently, this dynamic tag only outputs the parent post ID.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Nazim Husain

    (@nazim848)

    Also, I would love to know why I am not able to get the loop item ID if used a custom shortcode inside the loop?

    This shortcode only has echo get_the_ID();

    It echoes the same post ID in every loop item instead of the unique post IDS.

    Any thoughts?

    Plugin Support ying

    (@yingscarlett)

    Hi there,

    Post is not a Hierarchical post type, so there’s no such a thing called parent post. Can you explain some more?

    Shortcode does not work in query loop, it’s a known WP issue. You will need to use the render_block() filter to do_shortcode().

    function apply_shortcodes_in_query_loop($block_content, $block) {
    if ($block['blockName'] === 'core/shortcode') {
    return do_shortcode($block_content);
    }
    return $block_content;
    }
    add_filter('render_block', 'apply_shortcodes_in_query_loop', 10, 2);
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Dynamic Data: Parent Post Title with Link’ is closed to new replies.