• 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

Space between Widgets

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 › Space between Widgets

This topic is: not resolved
  • This topic has 3 replies, 2 voices, and was last updated 8 years, 5 months ago by sunnypapabear.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • July 25, 2017 at 6:02 pm #209581
    sunnypapabear
    Member

    I've Registered a widget to go on a Static Page on my Front Page that creates two side-by-side widgets. However, I have not figured out how to put a small space between the two widgets. Below is the Custom Code that went into the Functions.php and then the Custom CSS to style the widgets.

    I am running the Prose Theme - XHTML not HTML5.

    Custom Code for Function.php:
    // Register page widget areas

    genesis_register_sidebar( array(
    'id' => 'page-widget-left',
    'name' => __( 'Page Widget Left', 'nabm' ),
    'description' => __( 'This is the left widget area for a specific page.', 'nabm' ),
    ) );
    genesis_register_sidebar( array(
    'id' => 'page-widget-right',
    'name' => __( 'Page Widget Right', 'nabm' ),
    'description' => __( 'This is the right widget area for a specific page.', 'nabm' ),
    ) );

    // Add the page widget in the content
    add_action( 'genesis_after_post_content', 'nabm_add_page_content' );
    function nabm_add_page_content() {
    if ( is_page('1522') ) {

    echo '<div class="page-widget-container"><div class="wrap">';

    genesis_widget_area ('page-widget-left', array(
    'before' => '<div class="page-widget one-half first">',
    'after' => '</div>',
    ) );

    genesis_widget_area ('page-widget-right', array(
    'before' => '<div class="page-widget one-half">',
    'after' => '</div>',
    ) );

    echo '</div></div>';

    }
    }

    Custom Code for CSS:
    /* Front Page Widgets for after Content */
    .page-widget {
    line-height: 1.5;
    padding: 5px;
    border: 1px solid #FFFFFF;
    }

    .page-widget p {
    margin-bottom: 24px;
    text-align: center;
    padding: 5px;
    font-size: 14px;
    }

    .page-widget.one-half {
    padding: 5px;
    width: 45%;
    float: center;
    }

    July 25, 2017 at 6:09 pm #209583
    sunnypapabear
    Member

    Forgot the URL http://PeterCruikshank.com/dev

    July 27, 2017 at 6:34 pm #209650
    PyramidWeb
    Member

    Hi Peter,

    First, "float: center;" does not exist, see in the css you posted above. This is correct (I guess it's correct in your css already):

    .page-widget.one-half {
        float: left;
        padding: 5px;
        width: 45%;
    }
    

    Second, to put a small space between the widgets, seach for ".first" in your css and change it as follows or add this part to your custom css:

    .first {
        clear: both;
        margin-right: 5%;
    }
    

    This adds a margin of 5% to the right side of the first (i.e., the left) of the two widgets. You might need to omit "clear: both;" if you add the above css to your custom css, depending on where this custom part is inserted.

    July 27, 2017 at 6:59 pm #209652
    sunnypapabear
    Member

    Thanks, that solve the problem. Appreciate it.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 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

© 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