Site logo

Archived topic

Advanced Popups

9 replies · Started by Rob on June 30, 2022

Viewing posts 1–10 of 10

Hi there,

Im using Advanced Popups. Which allows me to add GenerateBlocks into the post.

However, when I then test the form, it pops up, it has the content, it even has gb- classes in the markup. But its not respecting the grid/container settings from GenerateBlocks.

Is there a way to get this working correctly?

Rob.

Hi there,

What if you got to Settings > GenerateBlocks and set the CSS generation to: Inline ?

Hi David,

Still the same im afraid. Cache Dynamic CSS is also off.

Thanks
Rob.

Is it possible to ask the Pop up plugin author how the pop up is generated ? Presumably its a CPT,

Hi David,

Now this just might be a fluke but Ive got it working I think! Using 2 functions I found on the internet, and snooping in the plugins php I found the name of the CPT being registered.

add_filter( 'generateblocks_do_content', function( $content ) {
    $args = array(
        'post_type' => 'adp-popup',
        // Other args if you need them.
    );

    $posts = get_posts( $args );

    foreach ( (array) $posts as $post ) {
        if ( isset( $post->post_content ) ) {
            $content .= $post->post_content;
        }
    }

    return $content;
} );

And also

add_filter( 'generate_blog_columns', function( $columns ) {
    if ( 'adp-popup' === get_post_type() && ! is_singular() ) {
        return true;
    }

    return $columns;
} );

Might be worth you guy adding this to your internal KB, if it helps.

Rob.

In fact it seems to work fine without the 2nd snippet actually.

Hey David,

Thanks :)

Its this one.

Rob.

Thanks Rob - much appreciated!

This archived topic is closed to new replies.