douguan1887 2017-03-14 19:56
浏览 62
已采纳

修复WordPress标题

I was provided this bit of code to add to my functions.php file by the support team of the company from whom I bought the theme.

I wanted my logo and site name side by side and they gave me this code:

function igthemes_site_logo() { 
$custom_logo_id = get_theme_mod( 'custom_logo' );
$image = wp_get_attachment_image_src( $custom_logo_id , 'full' );
$url = home_url( '/' );
echo '<a href="' . esc_url( $url ) .'">'; 
echo "<img class='logo' src= " . $image[0] . " style='float:left; padding:15px;'>";
echo '<div style="float:left; padding:15px 0;">' . get_bloginfo( 'title' ) . '</div>';
echo '</a>';
}

However, that made it look like this.Two logos and titles

What do I change to just show one logo and one title?

  • 写回答

1条回答 默认 最新

  • doulupian8725 2017-03-15 17:17
    关注

    it seems like that php function (igthemes_site_logo()) is called twice. That would be in the PHP code, not in the code you posted which only contains the function itself.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?