Site logo

[Resolved] Using GP styles as default in GenerateBlocks

Home Forums Support [Resolved] Using GP styles as default in GenerateBlocks

Home Forums Support Using GP styles as default in GenerateBlocks

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2412114
    Sue

    I found this 2020 post from Tom re: how to “tell GenerateBlocks to use the GP styles as its default”:
    https://generatepress.com/forums/topic/add-custom-css-selector-to-the-button-selector/#post-1322768
    His post contains some code that starts with “add_filter( ‘generateblocks_defaults’, function( $defaults ) {”

    Where do I put this code? Do I use Elements, or a plugin like Code Snippets?
    I am hoping that eventually the GenerateBlocks button styles will integrate with the GP customizer to make this easier!

    #2412397
    David
    Staff
    Customer Support

    Hi there,

    that code is PHP, this article explains how to add it:

    https://docs.generatepress.com/article/adding-php/

    TLDR: Are you using a Child Theme?
    If Yes, then you can add that code to your Child Themes functions.php
    If No, then use the Code Snippets plugin and add it to a New Snippet.

    #2413068
    Sue

    I am not using a child theme, so I installed Code Snippets. I have set the button background to be a reddish color in the customizer, but it’s still showing the blue background which appears to be the GenerateBlocks default for buttons in a group.

    #2413471
    David
    Staff
    Customer Support

    Were those buttons added after you added the code snippet ?

    #2414046
    Sue

    Ah, that was the trick! I removed that button group and put in a new one, and now they look fine. Thanks so much!!

    #2414534
    David
    Staff
    Customer Support

    Glad to hear that!!

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