the answer for all question about Oxygen Builder plugin and WordPress

Does anyone know offhand how to show a block based photo gallery in the easy posts list? Previously

Does anyone know offhand how to show a block based photo gallery in the easy posts list? Previously I just used get_post_gallery under the the_excerpt area in the php block.



Source

Capital Design Set

Mega Design Set - 500+ Blocks

1 Comment
  1. Joe says

    This is what i ended up doing:

    if(has_block(‘gallery’, get_the_content())) {

    $post_blocks = parse_blocks(get_the_content());

    foreach ($post_blocks as $post_block){
    if ($post_block[‘blockName’] == ‘core/gallery’){
    echo do_shortcode($post_block[‘innerHTML’] );
    }
    }
    }

Leave A Reply

Your email address will not be published.

Oxyrealm Docs OxyMade - Oxygen Builder Design Set Mega collection