[Resolved] Widget Title Code

Home Forums Support [Resolved] Widget Title Code

Home Forums Support Widget Title Code

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2358093
    Bernhard

    Hi there,
    I have a problem with Advanced Ads as it still uses the classic editor. They have a way to insert code but I have a problem with the GB headline block.

    Time ago I got the following to make Advanced Ads working with GB CSS but it seems not to work with the headline block:

    add_filter( 'generateblocks_do_content', function( $content ) {
        $post_ids = array( 42332, 42333 ); // A post ID to check the content of. Can be dynamically set.
    
        foreach ( $post_ids as $post_id ) {
            if ( has_blocks( $post_id ) ) {
                $block_element = get_post( $post_id );
    
                if ( ! $block_element || 'advanced_ads' !== $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;
    } );

    Basically, as a workaround, I want to use the formatting of the widget title, but I don’t know, how to address it (like H?).

    Sample URL

    Screenshot

    #2358163
    Ying
    Staff
    Customer Support

    Can you try adding an additional CSS class widget-title to the headline block?

    #2358174
    Bernhard

    Hi Ying,
    yess, it works πŸ™‚

    It seems that I don’t need the above filter in this case. The only thing would be to have a CSS class to center the title and the image.

    Thank you.

    #2358199
    Ying
    Staff
    Customer Support

    You are welcome πŸ™‚

    #2358222
    Bernhard

    OK, only about the CSS Class to center image and title. Is there a CSS class in the theme or shall I define it by my own?

    #2358509
    Fernando
    Customer Support

    Hi Bernhard,

    Try adding this CSS in Appearance > Customize > Additional CSS:

    aside .touri-target > * {
        text-align: center;
    }
    #2358716
    Bernhard

    Thank you πŸ™‚

    #2358748
    Fernando
    Customer Support

    You’re welcome Bernhard!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.