• 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

nickhempsey

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
  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • October 30, 2014 at 12:03 pm in reply to: Add an ID to Primary Sidebar #129916
    nickhempsey
    Member

    right right right. Thanks!

    One adjustment though.

    add_filter( 'genesis_attr_sidebar-primary', 'gd_attributes_sidebar_primary' );
    function gd_attributes_sidebar_primary( $attributes ){
      $attributes['id']     = 'sidebar';
    
      return $attributes;  // Removed ['class']
    }
    September 29, 2014 at 9:24 am in reply to: How to check what layout is being loaded? #126162
    nickhempsey
    Member

    @imartins , that code shouldn't set the layout, only return the active layout.

    I'm wondering .. are you wrapping this code into a function or just firing it directly in functions.php?

    If you have that code directly in functions.php I would suggest making a function that places it in genesis_meta instead.

    add_action('genesis_meta', 'mw_conditional_attachments');
    function mw_conditional_attachments() {
       $site_layout = genesis_site_layout();
       if ( $site_layout == 'sidebar-content-sidebar' ) {
         add_action( 'genesis_before_entry', 'mw_add_attachments' );
       } else {
         add_action( 'genesis_entry_footer', 'mw_add_attachments' );
       }
    }
    function mw_add_attachments(){
      $attachments = new Attachments( 'attachments' ); /* pass the instance name */
      if ($attachments->exist()) {
        ?>
          <ul class="files">
            <?php while( $attachments->get() ) : ?>
              <li>
                <div class="files-thumbnail">
                  <?php echo $attachments->image( 'thumbnail' ); ?>
                </div>
                <div class="files-details">
                  <a href="<?php echo $attachments->url(); ?>" target="_blank" class="files-title">
                    <?php echo $attachments->field( 'title' ); ?>
                  </a>
                  <div class="files-meta"><?php echo $attachments->subtype(); ?> - <?php echo $attachments->filesize(); ?></div>
                  <div class="files-caption">
                    <?php echo $attachments->field( 'caption' ); ?>
                  </div>
                </div>
              </li>
    
            <?php endwhile; ?>
          </ul>
        <?php
      }
    }

    let me know if that helps at all.

    June 16, 2014 at 8:52 am in reply to: How to check what layout is being loaded? #109983
    nickhempsey
    Member

    I did some digging in genesis/lib/structure/layout.php and found the function genesis_site_layout(); It returns the active layout of the page. So I can do this:

    $site_layout = genesis_site_layout();
    
    //* Load custom code when content-sidebar is active
    if('content-sidebar' == $site_layout ){
       //* Do something
    }
    June 16, 2014 at 8:35 am in reply to: How to check what layout is being loaded? #109979
    nickhempsey
    Member

    Thanks Brad,

    I'm not looking to create a custom layout, although I will go that route if all else fails.

    I just need to know whether or not the current layout is using the primary sidebar or not.

    February 16, 2013 at 9:55 am in reply to: Studio412 Design :: Feedback #20682
    nickhempsey
    Member

    Thanks Charles!

    February 15, 2013 at 5:03 pm in reply to: Studio412 Design :: Feedback #20605
    nickhempsey
    Member

    Thanks Bandj, I appreciate that!

    February 12, 2013 at 8:55 am in reply to: Studio412 Design :: Feedback #19819
    nickhempsey
    Member

    Thanks Susan!

    I spent a lot of time on the header, I really wanted that feel to carry through every device and the only way to do it was to completely change the layout of the links and logo.  🙂  It took almost two full days just for the header (including pulldowns), but I think it was worth it.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)

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