简体   繁体   English

WordPress的单个帖子内容侧栏

[英]Wordpress Single post content sidebar

In the single post page if I want to place post's title and image on top (100% width) and below them the content on left with sidebar on right is it ok to put the sidebar in the article ? 在单个帖子页面中,如果我想将帖子的标题和图像放在顶部(宽度为100%),并在其下方,则将内容放置在左侧,并在右侧添加侧边栏?

   <main class="main" role="main">
       <article id="post-65035" class="post type-post">
            <header class="entry-header">
                <h1 class="entry-title"></h1>              
            </header>

            <div class="entry-image">
            </div>

            <div class="entry-content">
            </div>

            <aside class="sidebar">
            </aside>
       </article>
   </main>

yes: default looks like this , inside an div 是的: 默认div内看起来像这样

 <div id="sidebar" class="sidebar">
    <?php get_sidebar(); ?>
 </div>

So for yours if you do it like this you wil have to customize the css . 因此,如果您这样操作,则必须自定义css

<aside class="sidebar" id="sidebar">
   <?php get_sidebar(); ?>
</aside> 

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

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