• 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

Opinion on approach

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 › Opinion on approach

This topic is: not a support question

Tagged: Sidebar, widget

  • This topic has 1 reply, 2 voices, and was last updated 7 years, 4 months ago by carasmo.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 15, 2015 at 3:53 pm #171216
    eddie
    Participant

    Please see the following pages, they both are the same custom post type.

    1. http://smri.io/nvsu - has some additional information such as a picture and a map. The sidebar is created only if one or both has data.
    2. http://smri.io/6xzd - has no additional information, so no sidebar is created.

    So, my question is one of approach since I'm new to this framework. Is this a viable approach, or should I be creating a widget and populating it or something?

    This is a custom post type

    November 15, 2015 at 4:27 pm #171218
    carasmo
    Participant

    One of the rules of typography is to have narrow passages of long text to improve readability, however that has been unproven with some tests, though hardly empirical data. I worked with typographers before the days of Mac, and all around in print, you generally don't see long passages of text except in coffee table books, but even then it's rare. I prefer narrower columns, so the one with the sidebars or even skinny down the middle, which is some more CSS for that page. There's a way to add a slug to your page to reflect the page title.

     // Slug Body Class
    
    function add_slug_body_class($classes)
    	{
    	global $post;
    	if (isset($post))
    		{
    		$classes[] = $post->post_type . '-' . $post->post_name;
    		}
    
    	return $classes;
    	}
    
    add_filter('body_class', 'add_slug_body_class');
    

    So now my Contact page is "page-contact"

    and I can use that to address the main column and make it a max-width of something I like on a larger device.

    /* assumes full width no sidebar on this page */
    .page-contact .content {
        margin-left:auto;
        margin-right:auto;
        max-width:700px;
    }
    

    Genesis Theme Customization and Help

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ 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