Community Forums › Forums › Archived Forums › Design Tips and Tricks › Is there a way to make certain words in the tagline bold?
Tagged: Tagline Bold
- This topic has 2 replies, 2 voices, and was last updated 8 years, 6 months ago by nhlennox.
-
AuthorPosts
-
March 1, 2016 at 11:41 am #180344nhlennoxMember
I've noticed some companies (Facebook, Airbnb, etc) have their names in bold in the tagline. Is there a way to make certain words bold in the tagline using CSS or something else?? I tried html but that didn't work.
March 1, 2016 at 2:13 pm #180365Victor FontModeratorThere are a couple of ways to do this, both require overwriting the genesis function. Add either to your theme's functions.php.
First method is to add the tagline directly in the function. Change the value of $inside to whatever you want your tagline to be.
remove_action( 'genesis_site_description', 'genesis_seo_site_description' ); add_action( 'genesis_site_description', 'my_seo_site_description' ); function my_seo_site_description() { //* Set what goes inside the wrapping tags $inside = '<span color="red">my description</span>'; //* Determine which wrapping tags to use $wrap = genesis_is_root_page() && 'description' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p'; //* Wrap homepage site description in p tags if static front page $wrap = is_front_page() && ! is_home() ? 'p' : $wrap; //* And finally, $wrap in h2 if HTML5 & semantic headings enabled $wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h2' : $wrap; /** * Site description wrapping element * * The wrapping element for the site description. * * @since 2.2.3 * * @param string $wrap The wrapping element (h1, h2, p, etc.). */ $wrap = apply_filters( 'genesis_site_description_wrap', $wrap ); //* Build the description $description = genesis_html5() ? sprintf( "<{$wrap} %s>", genesis_attr( 'site-description' ) ) : sprintf( '<%s id="description">%s</%s>', $wrap, $inside, $wrap ); $description .= genesis_html5() ? "{$inside}</{$wrap}>" : ''; //* Output (filtered) $output = $inside ? apply_filters( 'genesis_seo_description', $description, $inside, $wrap ) : ''; echo $output; }
The second method is to add the HTML markup to the WordPress tagline and use this code:
remove_action( 'genesis_site_description', 'genesis_seo_site_description' ); add_action( 'genesis_site_description', 'my_seo_site_description' ); function my_seo_site_description() { //* Set what goes inside the wrapping tags $inside = html_entity_decode(get_bloginfo('description')); //* Determine which wrapping tags to use $wrap = genesis_is_root_page() && 'description' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p'; //* Wrap homepage site description in p tags if static front page $wrap = is_front_page() && ! is_home() ? 'p' : $wrap; //* And finally, $wrap in h2 if HTML5 & semantic headings enabled $wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h2' : $wrap; /** * Site description wrapping element * * The wrapping element for the site description. * * @since 2.2.3 * * @param string $wrap The wrapping element (h1, h2, p, etc.). */ $wrap = apply_filters( 'genesis_site_description_wrap', $wrap ); //* Build the description $description = genesis_html5() ? sprintf( "<{$wrap} %s>", genesis_attr( 'site-description' ) ) : sprintf( '<%s id="description">%s</%s>', $wrap, $inside, $wrap ); $description .= genesis_html5() ? "{$inside}</{$wrap}>" : ''; //* Output (filtered) $output = $inside ? apply_filters( 'genesis_seo_description', $description, $inside, $wrap ) : ''; echo $output; }
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?March 1, 2016 at 2:33 pm #180367nhlennoxMemberThank you.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.