Forum Replies Created
-
AuthorPosts
-
wario
MemberHi 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.
wario
MemberHey 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.
wario
MemberCool, 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!
wario
MemberI 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.
wario
MemberI 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.
wario
MemberThe 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.
wario
MemberWhat kind of responsive menu are you talking about? As in collapsable tabs with an icon?
-
AuthorPosts