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.

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

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥20 求用stm32f103c6t6在lcd1206上显示Door is open和password:
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法