-
AuthorPosts
-
February 26, 2015 at 9:14 pm #402985
I want to put my logo in H1 tag in similar syntax:
<h1> <a href="/" rel="home"> <img src="logo.png" alt="Brand" /> </h1>
What files and what I change to make this?
- This topic was modified 9 years, 8 months ago by ivailo_georgiev.
February 27, 2015 at 6:05 am #403178Hey!
Try adding this at the very end of your theme / child theme functions.php file:
add_filter( 'avf_logo_headline', 'change_logo_to_h1', 10); function change_logo_to_h1() { return "h1"; }
Cheers!
JosueFebruary 27, 2015 at 8:59 am #403254Thank you Josue! It is works. But one more question, please! :) How I can add and rel=”home” in:
<a href="/" rel="home"> <img src="logo.png" alt="Brand" />
- This reply was modified 9 years, 8 months ago by ivailo_georgiev.
February 27, 2015 at 11:30 pm #403733Hi!
Use this code instead:
add_filter( 'avf_logo_final_output', 'change_logo', 10, 6); function change_logo($logo, $use_image, $headline_type, $sub, $alt, $link) { $logo = "<h1 class='logo'><a href='".$link."' rel='home'>".$logo."$sub</a></h1>"; return $logo; }
Best regards,
JosueFebruary 28, 2015 at 10:32 am #403810It is change, but position of the logo misaligned in site. It is ugly :(
https://www.dropbox.com/s/pyngkfwb8zutgpy/logo-problem.jpg?dl=0
February 28, 2015 at 8:09 pm #403887Hi,
Can you post the link to your website please?
Regards,
JosueFebruary 28, 2015 at 8:11 pm #403889Yes, site is gigadesign.bg. But now I remove last code.
February 28, 2015 at 8:39 pm #403896Hi!
Remove the previous codes i suggested and put the following in your child theme functions.php:
function avia_logo($use_image = "", $sub = "", $headline_type = "h1", $dimension = "") { $use_image = apply_filters('avf_logo', $use_image); //$headline_type = apply_filters('avf_logo_headline', $headline_type); $headline_type = "h1"; $sub = apply_filters('avf_logo_subtext', $sub); $alt = apply_filters('avf_logo_alt', get_bloginfo('name')); $link = apply_filters('avf_logo_link', home_url('/')); if($sub) $sub = "<span class='subtext'>$sub</span>"; if($dimension === true) $dimension = "height='100' width='300'"; //basically just for better page speed ranking :P if($logo = avia_get_option('logo')) { $logo = apply_filters('avf_logo', $logo); if(is_numeric($logo)){ $logo = wp_get_attachment_image_src($logo, 'full'); $logo = $logo[0]; } $logo = "<img {$dimension} src='{$logo}' alt='{$alt}' />"; $logo = "<$headline_type class='logo'><a href='".$link."' rel='home'>".$logo."$sub</a></$headline_type>"; } else { $logo = get_bloginfo('name'); if($use_image) $logo = "<img {$dimension} src='{$use_image}' alt='{$alt}' title='{$logo}'/>"; $logo = "<$headline_type class='logo bg-logo'><a href='".$link."' rel='home'>".$logo."$sub</a></$headline_type>"; } $logo = apply_filters('avf_logo_final_output', $logo, $use_image, $headline_type, $sub, $alt, $link); return $logo; }
Best regards,
JosueFebruary 28, 2015 at 8:44 pm #403898Man, you are king! It is works fine.
Thank you for help!
February 28, 2015 at 9:08 pm #403904You are welcome, glad to help :)
Regards,
Josue -
AuthorPosts
- The topic ‘Logo in H1 tag Syntax’ is closed to new replies.