• 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

Sidebar content falls outside of widget on CPT

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 › Sidebar content falls outside of widget on CPT

This topic is: resolved

Tagged: Sidebar, widget, widget area

  • This topic has 1 reply, 1 voice, and was last updated 8 years, 8 months ago by simbasounds.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • January 9, 2015 at 8:17 am #136474
    simbasounds
    Member

    This may be related to Simple Sidebars specifically, but I'm asking here just in case:

    I've swopped sidebars for a custom post type and taxonomy using the following code:

    //* Add custom sidebar to custom post and taxonomy
    add_action( 'get_header', 'add_charity_sidebar' );
    function add_charity_sidebar() {
    	if ( is_post_type_archive( 'charity' ) || is_singular( 'charity' ) || is_tax('charity-category') ) {
    		remove_action( 'genesis_sidebar', 'ss_do_sidebar' );
    		remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
    		add_action( 'genesis_sidebar', 'charity_widget_area' );
      }
    }
    function charity_widget_area() {
    	genesis_widget_area( 'charity-selector' );
    }

    But my text widget content is appearing before the widget itself ie.

    <aside class="widget-area">
        <div>My Content</div>
        <section class="widget-text"></section>
    </aside>

    instead of:

    <aside class="widget-area">
        <section class="widget-text">
            <div>My Content</div>
        </section>
    </aside>

    Example of the problem

    http://simonbarnett.co.za/cycletour/charity/
    January 9, 2015 at 3:34 pm #136786
    simbasounds
    Member

    Ok, so this wasn't a Genesis or Simple Sidebars issue, rather an issue with the way I coded a shortcode in the widget.
    The solution came down to wrapping the shortcode html:

    ob_start();
    // html here
    return ob_get_clean();

    Longer explanation here.

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

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