Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 侧边栏显示在文章内容下方而不是旁边(Wordpress)_Html_Css_Wordpress - Fatal编程技术网

Html 侧边栏显示在文章内容下方而不是旁边(Wordpress)

Html 侧边栏显示在文章内容下方而不是旁边(Wordpress),html,css,wordpress,Html,Css,Wordpress,在尝试使我的侧边栏动态化时,发生了一些事情,导致我的整个侧边栏从博客容器的右侧推到所有文章内容的下方。我以前从未遇到过这个问题——我通常可以毫无问题地解决——所以我不确定该找什么。有什么想法吗 HTML/PHP <?php get_header( 'blog');?> <div id="blog-container"> <div id="blog"> <?php if (have_posts

在尝试使我的侧边栏动态化时,发生了一些事情,导致我的整个侧边栏从博客容器的右侧推到所有文章内容的下方。我以前从未遇到过这个问题——我通常可以毫无问题地解决——所以我不确定该找什么。有什么想法吗

HTML/PHP

<?php get_header( 'blog');?>

    <div id="blog-container">       
        <div id="blog">
            <?php if (have_posts()) : ?>
            <?php while (have_posts()) : the_post(); ?>
            <div class="post-title">
                <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
            </div><!-- end post-title -->
            <div class="post">
                <?php the_content('read more..'); ?>
            <div class="post-meta">
                <p><?php the_date(); ?> | <?php the_tags('tags:', ', ', ''); ?> | <?php comments_number( '0', '1 comment', '% comments' ); ?></p>
                <?php comments_template(); ?>
            </div><!-- end post-meta -->
                <?php endwhile; ?>
                <?php else : ?>
                    Nothing found.
                <?php endif;?>
            </div><!-- end post -->
        </div><!-- end blog -->
        <?php get_sidebar(); ?>
        <?php get_footer(); ?>
    </div><!-- end blog-container -->

看起来某个元素缺少结束标记,因此您的边栏呈现在
#blog
div中。请尝试将
移到
上方

#sidebar {
    float: right;
    margin-top: 80px;
    padding-right: 10px;
    position: relative;
    width: 300px;
}

.blog-social {
    clear: both;
    padding-bottom: 20px;
    text-align: center;
}

.blog-social ul li {
    display: inline;
    padding-right: 10px;
}

.blog-social ul li:last-child {
    padding-right: 0px;
}

#sidebar .social-heading {
    text-align: center;
}

#sidebar #twitter-feed {
    font-family: podkova;
    font-size: 80%;
    color: #333333;
    letter-spacing: 1px;
    line-height: 1.5;
    padding-top: 20px;
    padding-bottom: 20px;
    width: 280px;
}

#sidebar #twitter-feed ul li {
    padding-bottom: 10px;
}

#sidebar #instagram-feed {
    padding-top: 20px;
    padding-bottom: 20px;
}