繁体   English   中英

如何在标题的末尾添加图像?

[英]How do I add an image to the end of a header?

我有一个wordpress网站,我需要在每个标题的末尾添加一个图像。 问题是这些是小部件,所有文本都被wordpress中的小部件替代。 有没有一种方法可以将图像硬编码到标题的末尾,从而不会被擦除?

<div class="grid_4 widget">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer 1') ) : ?>
<h2 class="beeh2">Widgetized Area 1</h2>
<p>Go to Appearance - Widgets section to overwrite this section. Use any widgets that fits you best. This is called <strong>Bottom Left</strong>.</p>
<?php endif; ?> 
<div class="clear"></div>
</div>

<div class="grid_4 widget">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer 2') ) : ?>
<h2 class="beeh2">Widgetized Area 2</h2>
<p>Go to Appearance - Widgets section to overwrite this section. Use any widgets that fits you best. This is called <strong>Bottom Middle</strong>.</p>
<?php endif; ?> 
<div class="clear"></div>

我还注意到,当我检查网站时,我创建的h2类也不存在。 这似乎也被覆盖了。

在functions.php(或其中包含的文件)中,您应该看到“ register_sidebar”。 页脚1和页脚2是自定义边栏,可能会覆盖您放置在小部件中的代码。 寻找类似下面的代码。

register_sidebar( array(
    'name'          => 'Footer 1',
    'id'            => 'footer-1',
    'before_widget' => '',
    'after_widget'  => '',
    'before_title'  => '',
    'after_title'   => '',
) );

“ before_title”和“ after_title”可能包含您的h2。 您可以使用html将图片添加到“ after_title”中。

希望有帮助!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM