• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Add a text field to each widget control form

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Add a text field to each widget control form

This topic is: resolved

Tagged: dynamic_sidebar_params

  • This topic has 6 replies, 3 voices, and was last updated 6 years, 3 months ago by AnitaC.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • November 24, 2019 at 9:57 pm #495018
    Fabio Nodari
    Participant

    Hi,
    I'd like to know if there is any code I can add to the function.php file to add a text field to each widget control form on my widget admin page.
    I currently do this using the ZigWidgetClass plugin. But if I can implement what he does without using a plugin would be better. I also honestly think this is a neat function that should be implemented in the framework and it shouldn't be too difficult.

    With this text field I can enter a CSS class name in the box and it will be added to the classes that WordPress applies to that widget instance. To add multiple classes I can simply separate them with a space.


    My Blog | My Instagram

    November 25, 2019 at 12:50 am #495021
    Brad Dalton
    Participant

    You could try the dynamic_sidebar_params hook which filters the parameters passed to a widget’s display callback.

    You can use this filter with specific widget id's.


    Tutorials for StudioPress Themes.

    November 25, 2019 at 1:05 am #495023
    Fabio Nodari
    Participant

    Sorry but I am quite a noob. How can I actually add the text field to the widget?


    My Blog | My Instagram

    November 25, 2019 at 1:16 am #495024
    Brad Dalton
    Participant

    Thats hook enables you to add the class directly to the widget without adding a custom field to each widget and the adding the class manually.

    You could do it using 1 filter function.

    You can search for dynamic_sidebar_params and might find some code which provides the solution you want.


    Tutorials for StudioPress Themes.

    November 25, 2019 at 1:25 am #495025
    Fabio Nodari
    Participant

    Ok thanks! Will do


    My Blog | My Instagram

    November 25, 2019 at 2:33 am #495026
    Fabio Nodari
    Participant

    Just realized that I could achieve the same result exclusively using css. 🙂 Thanks anyway


    My Blog | My Instagram

    November 25, 2019 at 8:55 am #495036
    AnitaC
    Keymaster

    @nfabiox85 if you start using the block editor to build, the blocks have additional css fields for you to name blocks so you can code them in the stylesheet. It's really pretty nice. I think the goal for WordPress is to move completely away from widgets, but that's down the road.


    Need help with customization or troubleshooting? Reach out to me.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Add a text field to each widget control form’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble