• 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

Prose theme – trouble adding custom widget

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 › Design Tips and Tricks › Prose theme – trouble adding custom widget

This topic is: not resolved

Tagged: custom widget, Prose

  • This topic has 4 replies, 3 voices, and was last updated 12 years, 6 months ago by David Chu.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • June 5, 2013 at 4:22 pm #44234
    swingbox
    Member

    Hi, I would like to add some text below the header and above the content area so I decided to add a custom widget area. In the function.php file, I have added the following code:

    genesis_register_sidebar( array(

    'id'        => 'before-content-ad',

    'name'      => 'Before Content Ad',

    'description'   => 'This is a sidebar that goes before the content.',

    ) );

    add_action( 'genesis_before_content_sidebar_wrap', 'child_before_content_ad_sidebar' );

    /** Loads a new sidebar before the content */

    function child_before_content_ad_sidebar() {

    echo '<div class="before-content-ad">';

    dynamic_sidebar( 'before-content-ad' );

    echo '</div>';

    }

    I expect to see a new custom widget area on dashboard but there is none .  What did I do wrong? I am very new to wordpress so please point me to the right direction.

    Thanks

    June 5, 2013 at 4:42 pm #44237
    David Chu
    Participant

    Hi,
    Your code looks good to me, at least at a glance. My best guess would be that your single quotes are not the right kind. I would try using the straight up-and-down ones. Yours are listing to starboard, so to speak. 🙂 Same deal with the double-quotes.

    Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    June 6, 2013 at 12:59 am #44273
    Brad Dalton
    Participant

    You need to add the code to your init.php file.

    Copy the code from the view raw link and paste it at the end of the file using a text editor like Notepad ++

    Code not displaying? Grab it on Github.

    You can also change the hook position if needed.


    Tutorials for StudioPress Themes.

    June 6, 2013 at 11:05 am #44360
    swingbox
    Member

    Thank you Brad and Dave! I is working perfectly. A lot of tutorial points me to adding the code to functions.php but Prose theme seems to handle things differently.

    Thanks again wordpress community!

    Wilfred

    June 6, 2013 at 11:13 am #44362
    David Chu
    Participant

    Wilfred,
    You're welcome. Functions.php is the normal way in Studiopress and regular WordPress themes. You can also add it via your own home-brewed function file.

    But it is true, Prose has a lot of custom code that's different from other Studiopress themes. I've wrestled with it a number of times - it's a real oddball, but has some cool functionality.

    Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 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