Community Forums › Forums › Archived Forums › Design Tips and Tricks › Displaying logo and tagline/description marked with h2 tag in Magazine Pro child
Tagged: header, Logo, Magazine Pro, site description
- This topic has 5 replies, 2 voices, and was last updated 8 years, 2 months ago by
yoyo2008.
-
AuthorPosts
-
February 11, 2017 at 8:41 am #200960
yoyo2008
ParticipantHi, I'm using Magazine Pro child theme since years and didn't had any prob to switch from text logo to image.
Now I would like to also add below the logo the tagline (wordpress description).On http://wpsites.net I found this PHP code to paste into functions.php of the child theme:
add_filter( 'genesis_seo_title', 'filter_title_with_logo', 10, 3 );
/**
* @author Brad Dalton
* @example http://wpsites.net/web-design/add-logo-above-taglinedescription-in-genesis/
* @copyright 2014 WP Sites
*/
function filter_title_with_logo( $title, $inside, $wrap ) {
$inside = sprintf( '', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) );
$title = sprintf('<%s class="site-title">%s</%s>', $wrap, $inside, $wrap);
return sprintf( '<%1$s id="title">%2$s</%1$s>', 'h1', $inside );
}Original URL for credits.
It just works perfectly, but I would like to mark the tagline with h2 tag.
I'm not skilled on PHP and CSS, how can I solve this?
Or are there any other ways tho show in the header a logo image above the site description, necessarily marked with h2 tag?
Thank you.February 11, 2017 at 8:58 am #200961Victor Font
ModeratorYou can use:
add_filter( 'genesis_site_description_wrap', 'h2' );
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 11, 2017 at 9:47 am #200964yoyo2008
ParticipantThank you very much Victor, I put it at the end of functions.php but a warning came out:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'h2' not found or invalid function name in /var/www/domains/websitename.com/public_html/wp-includes/class-wp-hook.php on line 298 < class="site-description" itemprop="description">This is the tagline
Do I have to inset that code in a particular point?
February 11, 2017 at 10:43 am #200967Victor Font
ModeratorSorry, ran too fast. Use this:
add_filter( 'genesis_site_description_wrap', 'description_h2_wrap' ); function description_h2_wrap() { return 'h2'; }
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 11, 2017 at 5:28 pm #200973yoyo2008
ParticipantOh, thank you Victor! Everything's ok.
February 12, 2017 at 11:37 am #201001yoyo2008
ParticipantSorry the only thing I cannot figure it is, finally I have to put the two code snippets in functions.php? Like this?
add_filter( 'genesis_seo_title', 'filter_title_with_logo', 10, 3 );
/**
* @author Brad Dalton
* @example http://wpsites.net/web-design/add-logo-above-taglinedescription-in-genesis/
* @copyright 2014 WP Sites
*/
function filter_title_with_logo( $title, $inside, $wrap ) {
$inside = sprintf( '', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) );
$title = sprintf('<%s class="site-title">%s</%s>', $wrap, $inside, $wrap);
return sprintf( '<%1$s id="title">%2$s</%1$s>', 'h1', $inside );
}add_filter( 'genesis_site_description_wrap', 'description_h2_wrap' );
function description_h2_wrap() {
return 'h2';
}Doing this in my Magazine Pro child theme it now marks h2 the description
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
but it didn't shows it.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.