Community Forums › Forums › Archived Forums › Design Tips and Tricks › Header Image link to homepage
- This topic has 9 replies, 2 voices, and was last updated 11 years, 11 months ago by JestersTear.
-
AuthorPosts
-
January 13, 2013 at 7:48 pm #11713akarimiMember
Hello,
I'm not sure if I searched correctly for an existing topic but my question is that I would like to link my header image (logo) to link back to the homepage when clicked. I tried the snippet code on studiopress in functions.php but was not successful:
/** Modify the header URL */
add_filter('genesis_seo_title', 'custom_seo_title', 10, 3);
function custom_seo_title($title, $inside, $wrap) {
$inside = sprintf( '%s', esc_attr( get_bloginfo('name') ), get_bloginfo('name') );
$title = sprintf('%s', $wrap, $inside, $wrap);
return $title;
}January 13, 2013 at 8:38 pm #11722JestersTearParticipantI'm assuming you only have a header image, but no text? If so you need to go into Genesis > Theme Settings and, under Header select Use for site title/logo: Image Logo.
This will only work if your site's description isn't "real" text as well because, if it is, selecting Image Logo will make the description disappear.
Monica | jesterstear on twitter | monicaguerraleiria.com
January 13, 2013 at 8:49 pm #11723akarimiMemberYes the header is an image.
I am not sure what function you are talking about. I dont have Header and option to select image logo under my Genesis Theme Settings. I just have two text boxes for Header and Footer Scripts.
I just now used the code snippet to remove site title and description but now the code to have header redirect to a URL does not work.
Looking forward to further help!
January 13, 2013 at 9:19 pm #11724JestersTearParticipantI feel like I might have tried to start with the ending, rather than the beginning. Let me try this anew:
- If your header is an image that you can upload via Appearance > Header, then it should already automatically link to your homepage without you needing to do anything; if it isn't doing that, I have no idea what's causing it.
- If, on the other hand, your header is an image you're using via the background: url(imageurlhere); css property, then what I said in my first post is the answer, and there's a screenshot here to better illustrate it. Please let me know if this helps.
Monica | jesterstear on twitter | monicaguerraleiria.com
January 13, 2013 at 9:29 pm #11727akarimiMemberThanks for the reply,
I uploaded the header image via Appearance...I'm not sure why its not linking.
I also don't have that setting in your screenshot...I am sure I have updated to the newest Genesis as well...hmmmm
January 13, 2013 at 9:43 pm #11733JestersTearParticipantThat setting only shows up when the header *isn't* uploaded through Appearance (otherwise it should be automatic). Do you have a link to your site/can you post the contents of your functions.php?
Monica | jesterstear on twitter | monicaguerraleiria.com
January 13, 2013 at 9:45 pm #11734akarimiMemberyes, the site is rcmedreview.com
and the functions page looks like this:
__( 'Black' , 'education' ),
'education-green' => __( 'Green' , 'education' ),
'education-purple' => __( 'Purple' , 'education' ),
'education-red' => __( 'Red' , 'education' ),
'education-teal' => __( 'Teal' , 'education' )
) );add_action( 'genesis_meta', 'education_add_viewport_meta_tag' );
/** Add Viewport meta tag for mobile browsers */
function education_add_viewport_meta_tag() {}
/** Remove the site title */
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );/** Remove the site description */
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );/** Modify the header URL */
add_filter('genesis_seo_title', 'custom_seo_title', 10, 3);
function custom_seo_title($title, $inside, $wrap) {
$inside = sprintf( '%s', esc_attr( get_bloginfo('name') ), get_bloginfo('name') );
$title = sprintf('%s', $wrap, $inside, $wrap);
return $title;
}/** Add new image sizes */
add_image_size( 'featured-image', 150, 100, TRUE );remove_action('genesis_after_endwhile', 'genesis_posts_nav');
remove_action('genesis_after_endwhile','child_posts_nav');/** Add structural wraps */
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'inner',
'footer-widgets',
'footer'
) );add_action( 'pre_get_posts', 'be_exclude_category_from_blog' );
/**
* Exclude Category from Blog
*
* @author Bill Erickson
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @param object $query data
*
*/
function be_exclude_category_from_blog( $query ) {if( $query->is_main_query() && $query->is_home() ) {
$query->set( 'cat', '61' );
}}
/** Add support for custom background */
add_theme_support( 'custom-background' );/** Add support for custom header */
add_theme_support( 'genesis-custom-header', array(
'width' => 1140,
'height' => 120
) );/** Add support for 3-column footer widgets */
add_theme_support( 'genesis-footer-widgets', 3 );/** Customize the return to top of page text */
remove_action( 'genesis_footer_backtotop_text', 'custom_footer_backtotop_text' );/** Reposition Primary Navigation */
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_nav' );remove_action( 'genesis_newer_link_text' , 'custom_newer_link_text' );
remove_action( 'genesis_older_link_text' , 'custom_older_link_text' );
remove_action( 'genesis_prev_link_text' , 'custom_prev_link_text' );
remove_action( 'genesis_next_link_text' , 'custom_next_link_text' );/** Reposition Secondary Navigation */
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_subnav' );/** Remove the post meta function */
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );/** Remove the post info function */
remove_action( 'genesis_before_post_content', 'genesis_post_info' );/** Reposition Breadcrumbs */
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
add_action( 'genesis_before_content', 'genesis_do_breadcrumbs' );add_filter( 'genesis_comment_list_args', 'child_comment_list_args' );
/** Change avatar size */
function child_comment_list_args( $args ) {$args = array(
'type' => 'comment',
'avatar_size' => 33,
'callback' => 'genesis_comment_callback'
);return $args;
}
/** Register widget areas */
genesis_register_sidebar( array(
'id' => 'slider',
'name' => __( 'Slider', 'education' ),
'description' => __( 'This is the slider section.', 'education' ),
) );
genesis_register_sidebar( array(
'id' => 'intro',
'name' => __( 'Intro', 'education' ),
'description' => __( 'This is the intro section displayed below the slider.', 'education' ),
) );
genesis_register_sidebar( array(
'id' => 'featured',
'name' => __( 'Featured', 'education' ),
'description' => __( 'This is the featured section displayed below the intro.', 'education' ),
) );
genesis_register_sidebar( array(
'id' => 'call-to-action',
'name' => __( 'Call To Action', 'education' ),
'description' => __( 'This is the call to action banner.', 'education' ),
) );
if (!current_user_can('manage_options') ) { show_admin_bar(false); }
January 13, 2013 at 9:46 pm #11736akarimiMemberyes, the site is rcmedreview.com
and the functions.php looks like this:
__( 'Black' , 'education' ),
'education-green' => __( 'Green' , 'education' ),
'education-purple' => __( 'Purple' , 'education' ),
'education-red' => __( 'Red' , 'education' ),
'education-teal' => __( 'Teal' , 'education' )
) );add_action( 'genesis_meta', 'education_add_viewport_meta_tag' );
/** Add Viewport meta tag for mobile browsers */
function education_add_viewport_meta_tag() {}
/** Remove the site title */
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );/** Remove the site description */
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );/** Modify the header URL */
add_filter('genesis_seo_title', 'custom_seo_title', 10, 3);
function custom_seo_title($title, $inside, $wrap) {
$inside = sprintf( '%s', esc_attr( get_bloginfo('name') ), get_bloginfo('name') );
$title = sprintf('%s', $wrap, $inside, $wrap);
return $title;
}/** Add new image sizes */
add_image_size( 'featured-image', 150, 100, TRUE );remove_action('genesis_after_endwhile', 'genesis_posts_nav');
remove_action('genesis_after_endwhile','child_posts_nav');/** Add structural wraps */
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'inner',
'footer-widgets',
'footer'
) );add_action( 'pre_get_posts', 'be_exclude_category_from_blog' );
/**
* Exclude Category from Blog
*
* @author Bill Erickson
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @param object $query data
*
*/
function be_exclude_category_from_blog( $query ) {if( $query->is_main_query() && $query->is_home() ) {
$query->set( 'cat', '61' );
}}
/** Add support for custom background */
add_theme_support( 'custom-background' );/** Add support for custom header */
add_theme_support( 'genesis-custom-header', array(
'width' => 1140,
'height' => 120
) );/** Add support for 3-column footer widgets */
add_theme_support( 'genesis-footer-widgets', 3 );/** Customize the return to top of page text */
remove_action( 'genesis_footer_backtotop_text', 'custom_footer_backtotop_text' );/** Reposition Primary Navigation */
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_nav' );remove_action( 'genesis_newer_link_text' , 'custom_newer_link_text' );
remove_action( 'genesis_older_link_text' , 'custom_older_link_text' );
remove_action( 'genesis_prev_link_text' , 'custom_prev_link_text' );
remove_action( 'genesis_next_link_text' , 'custom_next_link_text' );/** Reposition Secondary Navigation */
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_subnav' );/** Remove the post meta function */
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );/** Remove the post info function */
remove_action( 'genesis_before_post_content', 'genesis_post_info' );/** Reposition Breadcrumbs */
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
add_action( 'genesis_before_content', 'genesis_do_breadcrumbs' );add_filter( 'genesis_comment_list_args', 'child_comment_list_args' );
/** Change avatar size */
function child_comment_list_args( $args ) {$args = array(
'type' => 'comment',
'avatar_size' => 33,
'callback' => 'genesis_comment_callback'
);return $args;
}
/** Register widget areas */
genesis_register_sidebar( array(
'id' => 'slider',
'name' => __( 'Slider', 'education' ),
'description' => __( 'This is the slider section.', 'education' ),
) );
genesis_register_sidebar( array(
'id' => 'intro',
'name' => __( 'Intro', 'education' ),
'description' => __( 'This is the intro section displayed below the slider.', 'education' ),
) );
genesis_register_sidebar( array(
'id' => 'featured',
'name' => __( 'Featured', 'education' ),
'description' => __( 'This is the featured section displayed below the intro.', 'education' ),
) );
genesis_register_sidebar( array(
'id' => 'call-to-action',
'name' => __( 'Call To Action', 'education' ),
'description' => __( 'This is the call to action banner.', 'education' ),
) );
if (!current_user_can('manage_options') ) { show_admin_bar(false); }January 13, 2013 at 9:48 pm #11738January 13, 2013 at 11:21 pm #11755JestersTearParticipantTry removing what you tried to do to the header - ie remove:
/** Remove the site title */
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );/** Remove the site description */
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );/** Modify the header URL */
add_filter('genesis_seo_title', 'custom_seo_title', 10, 3);
function custom_seo_title($title, $inside, $wrap) {
$inside = sprintf( '<a href="http://www.rcmedreview.com" title="%s">%s</a>', esc_attr( get_bloginfo('name') ), get_bloginfo('name') );
$title = sprintf('<%s id="title">%s</%s>', $wrap, $inside, $wrap);
return $title;
}then, in the header options, tell it to not display text along with your image, and see if that helps.
Monica | jesterstear on twitter | monicaguerraleiria.com
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.