doujiao3346 2015-06-11 13:29
浏览 29
已采纳

如何在自定义wordpress主题上添加徽标[关闭]

I'm building a WordPress theme from scratch at the moment and I seem to be stuck on trying to add a logo to the top left corner of the page where you would normally see the title of the page.

<h1>
  <a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a
</h1>
<div class="site-description">
    <h3>
        <?php echo html_entity_decode(get_bloginfo('description')); ?>
    </h3>
</div>`

So instead of the h1 tag there, I would like an image that will allow the user to return to the homepage. Also would I need to save the image in a specific folder ?

Please help and thank you in advance !

  • 写回答

2条回答 默认 最新

  • doucan9079 2015-06-11 13:53
    关注

    try this

    <img src="<?php bloginfo('template_directory'); ?>/images/logo.jpg" />
    <div class="site-description">
        <h3>
            <?php echo html_entity_decode(get_bloginfo('description')); ?>
        </h3>
    </div>
    

    assuming that image is in the images folder of template directory with file name logo.jpg

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 MATLAB动图问题
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名