admin管理员组文章数量:1329040
In the recent posts widget I have the post link first, and the post date second item, How can I change, to display the date in front of the post title?
Thank you.
register_sidebar( array(
'name' => __( 'Események', 'ashe' ),
'id' => 'esemenyek',
'description' => __( 'Add widgets here to appear in your sidebar.', 'ashe' ),
'before_widget' => '<div id="%1$s" class="ashe-widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<div class="widget-title"><h2>',
'after_title' => '</h2></div>',
) );
if ( is_active_sidebar( 'esemenyek' ) ) {
echo '<div class = "esemenyek">';
dynamic_sidebar( 'esemenyek' );
echo '</div>';
}
<li>
<a href="..post link">Post Title</a>
<span class="post-date">2020.07.26.</span>
</li>
In the recent posts widget I have the post link first, and the post date second item, How can I change, to display the date in front of the post title?
Thank you.
register_sidebar( array(
'name' => __( 'Események', 'ashe' ),
'id' => 'esemenyek',
'description' => __( 'Add widgets here to appear in your sidebar.', 'ashe' ),
'before_widget' => '<div id="%1$s" class="ashe-widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<div class="widget-title"><h2>',
'after_title' => '</h2></div>',
) );
if ( is_active_sidebar( 'esemenyek' ) ) {
echo '<div class = "esemenyek">';
dynamic_sidebar( 'esemenyek' );
echo '</div>';
}
<li>
<a href="..post link">Post Title</a>
<span class="post-date">2020.07.26.</span>
</li>
Share
Improve this question
edited Jul 29, 2020 at 6:03
Botond Vajna
asked Jul 29, 2020 at 5:51
Botond VajnaBotond Vajna
4714 silver badges11 bronze badges
1 Answer
Reset to default 2Unfortunately, this can't be done with filters, as it's hard-coded in the widget itself. You can see this here (currently latest version, referring to revision for accuracy over time).
What you can do is you can create your own widget, with the markup you wish. You can refer to this page on how to create your own custom widget.
There is a way to do this with JavaScript, but I would advice against it, as it's not a good practice to change the page markup client side, if that can be done server side.
本文标签: Display the date before the post title in recent posts widget
版权声明:本文标题:Display the date before the post title in recent posts widget 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742224549a2435940.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论