WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Mar 02 2011

Remove Post Title and Page Title from Genesis Child Theme (with or without Post Formats Support)

The same function controls the title for posts and pages; however, to remove the title from one or the other is different. As always open the functions.php in your favorite html/text editor or at Appearance > Editor (or in MS, found under Network Admin). Scroll to the bottom of the page and paste the code below into the functions.php file.

Remove Post Title from Posts

To remove all titles from posts, simply add the following:
[php]//REMOVE POST TITLE
remove_action('genesis_post_title', 'genesis_do_post_title');[/php]

With the introduction of Post Formats in WordPress 3.1, depending on its format, you may want to remove the post title. As it currently stands, has_post_format($arg1, $arg2) can only take a string in $arg1 and $arg2 is optional (and is $post_id), and the supported post formats from WordPress 3.1 are: aside, chat, image, link, quote, status, video, audio, and gallery. So to remove post titles from posts with these formats, simply add the following:
[php]if ( has_post_format( 'aside' ) || has_post_format( 'chat' ) || has_post_format( 'image' ) || has_post_format( 'link' ) || has_post_format( 'quote' ) || has_post_format( 'status' ) || has_post_format( 'video' ) || has_post_format( 'audio' ) || has_post_format( 'gallery' ) ) {
remove_action('genesis_post_title', 'genesis_do_post_title');[/php]

Remove Post Title from Pages

To remove page titles from specific pages, simply add the following:
[php]//REMOVE PAGE TITLE
add_action('get_header', 'child_remove_page_titles');
function child_remove_page_titles() {
$pages=array();
if (is_page($pages)) {
remove_action('genesis_post_title', 'genesis_do_post_title');
}
}[/php]

Or, to remove the title from the home page, simply add the following:
[php]//REMOVE PAGE TITLE FROM HOME PAGE
add_action('get_header', 'child_remove_page_titles');
function child_remove_page_titles() {
if (is_home()) {
remove_action('genesis_post_title', 'genesis_do_post_title');
}
}[/php]

Written by Travis Smith · Categorized: Genesis

Feb 28 2011

Add the Genesis Author Box to Pages

The Genesis tutorials tells how to set up Author Boxes, how to style Author Boxes, and how to add Author Boxes to Author Archive Pages.

As it currently stands, the author box can only be added to the author archive pages and the single post pages. And from what I see, it doesn't appear on pages like http://domain.com/page-name but does appear on http://domain.com/category/post-name. However, what if I wanted to have the author box appear on all the pages or just some or not on some. Well, here's how to do it.

To insert the author box on ALL pages:
[php]/** Add Genesis Author Box on Single Pages**/
add_action('genesis_after_post', 'genesis_do_author_box_page');
function genesis_do_author_box_page() {
if ( !is_page() )
return;

if ( get_the_author_meta( 'genesis_author_box_single', get_the_author_meta('ID') ) ) {
genesis_author_box( 'single' );
}

}[/php]

To insert the author box on ALL pages except...
[php]/** Add Genesis Author Box on Single Pages**/
add_action('genesis_after_post', 'genesis_do_author_box_page');
function genesis_do_author_box_page() {
$page_exclusions = array(42,'about-me','Contact'); //edit these pages, can take slugs, page names, or page/post ID
if ( ( !is_page() ) || is_page($page_exclusions) )
return;

if ( get_the_author_meta( 'genesis_author_box_single', get_the_author_meta('ID') ) ) {
genesis_author_box( 'single' );
}

}[/php]

To insert the author box on only certain pages:
[php]/** Add Genesis Author Box on Single Pages**/
add_action('genesis_after_post', 'genesis_do_author_box_page');
function genesis_do_author_box_page() {
$page_inclusions = array(42,'about-me','Contact'); //edit these pages, can take slugs, page names, or page/post ID
if ( is_page($page_inclusions) ) {
if ( get_the_author_meta( 'genesis_author_box_single', get_the_author_meta('ID') ) ) {
genesis_author_box( 'single' );
}
}
else
return;

}[/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

Feb 25 2011

How to Change Genesis's Speak Your Mind Comments Heading

For one of my sites, I wanted a more generic, gentler comment heading, so I needed to remove and/or change "Speak Your Mind." Here's how I did that.

[php]add_filter('genesis_comment_form_args', 'custom_comment_form_args');
function custom_comment_form_args($args) {
$args['title_reply'] = 'Leave a Comment';    // $args['title_reply'] = ''; for total removal
return $args;
}[/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

Feb 10 2011

Permenantly Fix Genesis's Admin Metabox Widths

In the StudioPress Support Forum, Charles Clarkson helped me with a problem that I've had for some time now. I have wanted StudioPress to change their .genesis-metaboxes .metabox-holder from its default of 800px to auto on the Theme Settings under Genesis tab (http://yourdomain.com/wp-admin/admin.php?page=genesis).

Genesis Default (800px): Click Image for Larger Image

However, after every upgrade I had to edit the admin.css to make this happen.

My Preference (auto): Click Image for Larger Image

So finally I posted this in the forums and Charles gave me the following code to free me from remembering to do that. And here it is:

[php]
add_action( 'admin_footer', 'child_widen_theme_settings' );
function child_widen_theme_settings() { ?>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready( function($) {
$( '.genesis-metaboxes, .genesis-metaboxes .metabox-holder' ).css( 'width', 'auto' );
//]]>
});
</script>
<?php
} [/php]

Written by Travis Smith · Categorized: Genesis

Jan 15 2011

StudioPress: WordPress's Best Themes on the Best Framework with SEO & Security Experts and the Best WordPress Support Group

Written by Travis Smith · Categorized: Genesis

  • « Previous Page
  • 1
  • …
  • 18
  • 19
  • 20
  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2025 � WP Smith on Genesis on Genesis Framework � WordPress � Log in