Site logo

[Support request] Using register_block_style to create custom styles for core blocks

Home Forums Support [Support request] Using register_block_style to create custom styles for core blocks

Home Forums Support Using register_block_style to create custom styles for core blocks

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2528914
    Anastasiya

    Hi,

    Is it possible to use Generatepress Elements to register custom style for one of the core blocks?
    I want to add selector of styles for the bullet list core block.
    Until now I was using a child theme of GP to add register_block_style in child theme functions.php file. Is it possible to achieve the same functionality without the child theme?

    here is sample code if you need it for reference:

    add_action('init', function() {
        register_block_style('core/list', [
    		'name' => 'brand-list',
    		'label' => __('Branded List', 'generatepress'),
    	]);
    });
    #2529353
    David
    Staff
    Customer Support

    Hi there,

    thats not something you can do with GP Elements.
    GP Elements are only for adding content to the front end templates.

    That kind of function needs to remain in the Child Theme 🙂

    #2531736
    Anastasiya

    Thanks for the clarification David.

    I’ll keep the child theme solution then.

    #2532667
    David
    Staff
    Customer Support

    You’re welcome

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