Archived topic
Button styling missing on frontend using Popup Builder plugin
7 replies · Started by spicerdigital on May 13, 2022
Hello there!
I am using the Popup Builder plugin to create popups to display further information when clicked and that all works well and looks great!
However, I have created a button within the popup to take the user to the booking page and the button styling on the backend is not showing up on the frontend. Click on (Learn More) button on each treatment section to view pop ups.
Any help would be much appreciated!
Many thanks!
Hi there,
go to Dashboard > GenerateBlocks > Settings and change the Dynamic CSS to Inline.
Does that work ?
Hi David
Thanks for your reply.
No, it doesn't appear to make any difference.The colours showing are those of links as per the customiser, so it's not showing button styling but treating it as a link for some reason.
Hi there
Thanks for the info.
I have added this to functions.php:
add_filter( 'generateblocks_do_content', function( $content ) {
$post_ids = array( 5772, 5841, 5843 );
foreach ( $post_ids as $post_id ) {
if ( has_blocks( $post_id ) ) {
$block_element = get_post( $post_id );
if ( ! $block_element || 'sg_popup' !== $block_element->post_type ) {
return $content;
}
if ( 'publish' !== $block_element->post_status || ! empty( $block_element->post_password ) ) {
return $content;
}
$content .= $block_element->post_content;
}
}
return $content;
} );
It hasn't changed the styling and I'm not sure what I'm doing wrong (I'm PHP illiterate...) I've raised a support ticket with the plugin dev and sent them the coding and the info you sent above, but haven't heard back yet.
Try adding this snippet:
add_filter( 'generateblocks_do_content', function( $content ) {
$args = array(
'post_type' => 'popupbuilder',
// 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;
} );
Boom! Fabulous. It works!
Thank you both for your help :D
Awesome - glad to hear that!!