• 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

wario

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
  • February 5, 2015 at 12:42 pm in reply to: Simple Sidebars and CPT archive #139831
    wario
    Member

    Hi Jeff,

    I'm looking for a work around CTP archive pages. You can add support for CTPs by adding a few line of code:

    
    //* Allow CTPs to use simple sidebars and simple menus
    add_post_type_support( 'ctp_id', 'genesis-simple-sidebars' );
    add_post_type_support( 'ctp_id', 'genesis-simple-menus' );
    

    Just replace 'ctp_id' with your custom post type id. However, this will only work for single CTPs, not the archive page. Looking for a solution still.

    You can find the simple sidebars option in Categories & Tags by going to your list of Categories or Tags and editing one. From the edit page you can select the sidebar of your choice.

    January 29, 2015 at 12:19 pm in reply to: add background image to beautiful theme header #138968
    wario
    Member

    Hey scottz,

    If you're trying to modify the full width header section to have a repeating background underneath your header logo and header navigation or widget area, you just need to target the .site-header in your styles.css. In your first post, you were targeting the wrap class within the header:

    .site-header .wrap {
    padding-bottom: 40px;
    padding-left: 0;
    padding-right: 0;
    padding-top: 46px;
    }

    Just remove the .wrap after .site-header:

    
    .site-header  {
    background-attachment: scroll;
    background-color: #444;
    background-image: url(“http://www.oluplaw.com/blog/wp-content/uploads/2014/07/HEADBG2.png”);
    background-repeat: repeat;
    }
    

    That should do the trick. Just replace the image location in quotes with wherever your image is.

    January 29, 2015 at 12:03 pm in reply to: Columns or Grid Display #138967
    wario
    Member

    Cool, glad you got it working.

    If you want to add a single featured post at the top, the easiest way would be to make a widget area and then use the built in Genesis Featured Post widget. That way you can always change if you wanted to add a notice, promotion, or some other content in addition to the featured post (or instead).

    I want to mention also, that you if you put the grid Archive Post Class function I gave you above in the functions file, you may run into an issue where a single post adopts the same class as well, so it may appear in a third or half column instead of the full content width. To avoid this you need to put that function in a home.php page template (and an archive.php if you want it to work for category archives as well). Or if you just want to keep it in your functions file you need wrap the inside of the function in an if() statement like this:

    
    /**
     * Archive Post Class
     * @since 1.0.0
     *
     * Breaks the posts into two or three columns
     * @link http://www.billerickson.net/code/grid-loop-using-post-class
     *
     * @param array $classes
     * @return array
     */
    function custom_archive_post_class( $classes ) {
    
    	if( ! is_singular() ) {
    		$classes[] = 'one-third';
    		global $wp_query;
    		if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 3 )
    			$classes[] = 'first';
    		return $classes;
    	}
    }
    
    add_filter( 'post_class', 'custom_archive_post_class' );
    

    It's the same as the first one, but just has the if() to check if it's a single post or not.

    Ok, so to add new widget area we'll hard code it in our functions.php file. You can also use the Genesis Simple Sidebars plugin, but this way will insure it doesn't get accidentally deleted. Either way will work, just make sure you grab the id (slug) if you use the plugin. Add this to your functions.php file:

    
    //* Register Featured Article Sidebar
    genesis_register_sidebar( 
    	array(
    		'id'            => 'home-featured-article',
    		'name'          => __( 'Homepage Featured Article', 'genesis' ),
    		'description'   => __( 'Featured article above the post grid.', 'genesis' ), 
    	)
    );
    

    If you haven't already made a front-page template or home template, create a file in your theme folder and call it home.php. This is what will load when someone visits the homepage. This template only works if you have your homepage set to your latest posts (not a static page) in your Reading Settings. Copy this into the home.php template:

    
    <?php
    
    //* Add the Featured Article section 
    add_action( 'genesis_after_header', 'home_featured_article' );
    function home_featured_article() {
    
    	echo '<div class="widget-area"><div class="wrap">';
    
    	if (is_active_sidebar( 'home-featured-article' )) { 
    		genesis_widget_area( 'home-featured-article', array(
    		'before' => '<div class="featured-single">',
    		'after' => '</div>'
    		) );
     	}
    	
    	echo '</div></div>';
    
    }
    
    /**
     * Archive Post Class
     * @since 1.0.0
     *
     * Breaks the posts into two or three columns
     * @link http://www.billerickson.net/code/grid-loop-using-post-class
     *
     * @param array $classes
     * @return array
     */
    function custom_archive_post_class( $classes ) {
    
    	$classes[] = 'one-third';
    	global $wp_query;
    	if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 3 )
    		$classes[] = 'first';
    	return $classes;
    }
    
    add_filter( 'post_class', 'custom_archive_post_class' );
    
    genesis();
    
    

    Again, if you have the Archive Post Class function in your functions.php file using the if() statement, you don't have to include it in the home.php. Actually, if you do you would get an error because you're defining the same function twice so make sure to double check that.

    And that should do it. The featured section will only appear if you something in that sidebar widget area, so be sure to drag over the featured posts widget and pick your settings.

    If you wanted to add 2 featured articles side by side, you would have to make 2 sidebars (you can add "left" and "right" to there names) and then add another if (is_active_sidebar()) function below the first. In each function add a "one-half" class name to the <div class= "featured-single">, and also add "first" class to the first one so they float correctly. That "featured-single" class is just there to help you style your post.

    Hope that helps!

    January 16, 2015 at 11:08 am in reply to: Hiding Page Title in Page Body (Beautiful Theme) #137679
    wario
    Member

    I would just use the Genesis Title Toggle plugin. You can set titles to be off by default (set in the Genesis Settings) and then turn them on a per page basis.

    January 16, 2015 at 9:44 am in reply to: Plug-in to restrict content? #137668
    wario
    Member

    I just found Simple Memberships Plugin and it looks awesome. Sets up monthly subscriptions to PayPal. I'm looking to use this on a premium Genesis Plugin I'm selling for downloads, member forums, etc. There's add-ons like Mailchimp integration/ It's in the WordPress repo too.

    January 16, 2015 at 9:24 am in reply to: Columns or Grid Display #137666
    wario
    Member

    The easiest way I've found to do posts in columns is with a filter that adds a class to posts. Found it on Bill Erikson's site:

    
    /**
     * Archive Post Class
     * @since 1.0.0
     *
     * Breaks the posts into two or three columns
     * @link http://www.billerickson.net/code/grid-loop-using-post-class
     *
     * @param array $classes
     * @return array
     */
    function custom_archive_post_class( $classes ) {
    
    	$classes[] = 'one-third';
    	global $wp_query;
    	if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 3 )
    		$classes[] = 'first';
    	return $classes;
    }
    
    add_filter( 'post_class', 'custom_archive_post_class' );
    

    The are two things to modify above depending on the grid columns you want.
    1.) The class string you are passing to the $classes[] array, in this case it's 'one-third'
    2.) The modulus ( % ) number is based off the grid column class. In this case it's 3 since we want 3 columns for the grid. This is used to check which posts get the 'first' class to make the grid work.

    You can put this in a page template if you want it to work on a per page basis, or just right in your functions.php file for all post (blog, archives, etc).

    Hope that helps.

    January 16, 2015 at 9:15 am in reply to: responsive menu – Genesis sample template #137665
    wario
    Member

    What kind of responsive menu are you talking about? As in collapsable tabs with an icon?

  • 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

© 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