For about a year now, I’ve started using the Genesis Framework from StudioPress almost exclusively and love it. There was a bit of a learning curve since the way that Genesis is built is a little different than the standard WordPress themes that I have been used to for years, but again – well worth it. The Genesis Framework is quite powerful and I’m still amazed at things I learn about it daily, so hats off to the StudioPress folks.
Now, the reason for my post – Genesis functions. As I mentioned earlier, Genesis is built a little different so there are some things to learn. All of what I’m about to show you is available online but I wanted to put it all here for you to read about and for me to reference later on. A great resource for this stuff can be found here: http://dev.studiopress.com/. Another tip – check other Genesis child theme’s functions.php files as some of this stuff can be found there, based on what theme you look at it will have some modifications you might find useful.
So back to my post. I had a client site I was working on a few weeks ago that needed some modifications and so I went searching. Below are some things I found that I hope you’ll find useful as well.
For this particular site all I needed was the content/sidebar layout. I wanted to remove the options for other layouts as that would be confusing for the client to see and not be able to use them, so if you’ll drop this piece of code into your child theme’s functions.php it will remove everything except for the “content/sidebar” layout (and obviously you can change this if you needed to remove a different layout, etc).
/** Unregister other site layouts */ genesis_unregister_layout( 'content-sidebar-sidebar' ); genesis_unregister_layout( 'sidebar-content' ); genesis_unregister_layout( 'full-width-content' ); genesis_unregister_layout( 'sidebar-sidebar-content' ); genesis_unregister_layout( 'sidebar-content-sidebar' ); |
Now when the client goes to the Genesis Theme Settings page they will see the layout selection like this:
With that change came another issue – the secondary sidebar. I was not going to use it, but again I didn’t want the client to see it in the Widgets screen and wonder why it didn’t work.
Drop this code into your child theme’s functions.php file to remove that secondary sidebar widget:
/** Unregister secondary sidebar */ unregister_sidebar( 'sidebar-alt' ); |
The next issue was the comments area of the site. This client wanted to use the commenting area for “Reviews” which is fine, except for the fact that the titles and such were still showing “Comments”
This screenshot was taken from a child theme demo on the StudioPress site. See up top where it says “Comments”? They wanted that to say “Reviews”, so here is the code you can drop into your child theme’s functions.php file to change that:
/** Modify the speak your mind text */ add_filter( 'genesis_comment_form_args', 'custom_comment_form_args' ); function custom_comment_form_args($args) { $args['title_reply'] = 'Leave a Comment'; return $args; } |
Next was the area when leaving a comment/review, there is some wording there that needed to be changed as well.
The “Speak Your Mind” text up top, and the “Post Comment” text in the submit button needed to be changed, so again, here is the code to place in the child theme’s functions.php file:
//Modify comments submit button and heading title add_filter('genesis_comment_form_args', 'custom_comment_form_args'); function custom_comment_form_args($args) { $args['label_submit'] = 'Submit Review'; $args['title_reply'] = 'Submit a Review'; return $args; } |
Like I said, most all of this stuff you can find online but I wanted to put it in one spot (mainly for myself) and hopefully it will help others out.
I have to give credit to Ron Rennick and Jared Atchison who came through with some help on these matters.
Ron says
Glad I was able to help ๐ Nice reference as well.
shaynesanderson says
Thanks Ron!
carl says
SWEET!! helped me out this…