最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

css - adding the_custom_logo(); to header

programmeradmin3浏览0评论

i want to show logo on navbar section.the logo appears but i cant control it with css.

        <?php wp_head(); ?>
<nav class="navbar navbar-expand-md navbar-light  sticky-top" style="background-color:rgb(3, 0, 180);" role="navigation">
  <div class="container" >
    <!-- Brand and toggle get grouped for better mobile display -->

    <a class="navbar-brand" href="#" > 
       <img src="<?php the_custom_logo(); ?>" height="42" width="42">



      </a>

i typed notes on screen picture:

.png

i want to show logo on navbar section.the logo appears but i cant control it with css.

        <?php wp_head(); ?>
<nav class="navbar navbar-expand-md navbar-light  sticky-top" style="background-color:rgb(3, 0, 180);" role="navigation">
  <div class="container" >
    <!-- Brand and toggle get grouped for better mobile display -->

    <a class="navbar-brand" href="#" > 
       <img src="<?php the_custom_logo(); ?>" height="42" width="42">



      </a>

i typed notes on screen picture:

https://i.ibb.co/w7rSkw3/11-A234233232ds-z.png

Share Improve this question asked Jul 3, 2019 at 13:02 Murat DenizMurat Deniz 77 bronze badges 2
  • Why is wp_head() there? That function needs to be inside the <head> element. – Jacob Peattie Commented Jul 3, 2019 at 13:10
  • @jacob thank you for this info – Murat Deniz Commented Jul 3, 2019 at 13:25
Add a comment  | 

1 Answer 1

Reset to default 1

The biggest issue you're running into is putting the_custom_logo() inside of an <img> tag. The function already outputs a full image tag, plus a link to the homepage wrapped around it. So, replace this

<a class="navbar-brand" href="#" > 
    <img src="<?php the_custom_logo(); ?>" height="42" width="42">
</a>

with this

<?php the_custom_logo(); ?>

to get rid of the first and third arrow in your screenshot.

发布评论

评论列表(0)

  1. 暂无评论