WordPress sidebar is being displayed underneath the post content rather than next to it

Visit Live Site

I recently encountered an issue where my sidebar, which is typically dynamic, suddenly shifted below all post content instead of staying on the right side of the blog container. This problem has not occurred before, and I'm unsure what may have caused it. Any suggestions or ideas on how to troubleshoot this?

Looking for solutions in HTML/PHP coding.

<?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 -->

Also seeking help with CSS styling.

#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;
}

Answer №1

There appears to be a missing closing tag for an element, causing your sidebar to render within the #blog div. I recommend shifting

</div><!-- end post -->
above <?php endwhile; ?>.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Creating a data visualization dashboard using Google Charts and organizing it in a responsive

I am integrating Google charts into a bootstrap theme. The Chart dashboard I am using has a specific structure: <div id="dashboard"> <div id="control1"></div> <div id="chart1"></div> </div> On the other ...

"Upon clicking, toggle the addition or removal of the overflow hidden

I'm currently working on a function to add and remove the CSS property .css('overflow-y','hidden') using an onclick event, which I have successfully implemented. However, I am encountering an issue when attempting to remove this CS ...

Aligning an icon vertically with wrapped text using CSS

My task involves reformatting predefined HTML using CSS to achieve a different layout. The HTML is received as an error message from the server and is not editable. .server-errors ul { list-style: none; } .server-errors li:before { content: "D"; f ...

The text following a table is spilling into the table because it is too big to fit within the designated div

I've been searching for a solution to this issue (it's a common problem), but nothing I've attempted has resolved it. Currently, I am using jQuery Mobile. Below is the code snippet in question: <div style="width:100%; height:220px;"> ...

How to create a bottom border in several TD elements using a combination of CSS and jQuery

Check out my Website: Search Page I have written some CSS that functions well when searching by Name, but not by Specialty: .displayresult { display: block; } #fname, #lname, #splabel, #addlabel, #pnlabel { border-width: 4px; border-bottom-st ...

CSS inline block is failing to create a new line

Hey there, I'm trying to create this webpage but I'm encountering an issue. I'm using the inline-block property, but it's not creating a new line; instead, everything is just staying in a straight line. I need it to move to a new line o ...

Difficulties with Bootstrap, JQuery, HTML, and CSS

Currently in the process of revamping a university society's website, I have some experience in web development but nothing too advanced. You can view the current website here: . Here is a sneak peek at the new design I am working on: . However, I& ...

Why is my grid not showing the elements properly in ReactJS and CSS?

Currently, I am working with ReactJS, GridCSS in the Gatsby framework. I am attempting to create a subgrid within a subcomponent of the Gatsby layout.js file. However, after setting up my grid, the subcomponent fails to display the component correctly in i ...

Ancient queries carry the weight of time

Extremely ancient, very old, incredibly aged beyond belief ...

Child container scrollbar covered by box-shadow

Currently, I am developing a page where on mobile devices, the navigation links need to be displayed horizontally and hidden via overflow if they are collectively too wide. To indicate to users that there are additional items to scroll through, I have adde ...

The JavaScript function does not function properly when it is called from another function

I tried my hand at creating a simple website for personal use, where I could input and edit text in an organized manner. A key feature I wanted was the ability to add new text fields dynamically by clicking a button, but it turned out to be more challengin ...

Looking to include a badge within the nebular menu

Can someone assist me with adding a badge to the Nebular menu to display the inbox count dynamically? Any help would be greatly appreciated. Thanks! import { NbMenuItem } from '@nebular/theme'; export const MENU_ITEMS: NbMenuItem[] = [ { ti ...

Achieving perfect alignment of two images within a block and maintaining their center position even when resizing

While working within a Wordpress post, my goal is to insert two images side by side with the block of images centered, one aligned left and the other aligned right (which I have achieved). As the page size decreases, I want the images to stack on top of e ...

Exploring Data in a Tree View Format on a PHP Website

Looking for advice on displaying categories and corresponding subcategories on the left side of my website (built using Php and Javascript). I would like the tree to be movable, similar to the functionality featured on this link: Any suggestions on how I ...

Utilizing JQuery Mobile to handle multiple forms on a single page and submitting each form uniquely by its ID using JQuery Post

After experimenting with assigning the same form ID to all forms on the page and also giving each form individual IDs with unique.submit functions, I encountered an issue where only the first form would work while the rest would redirect me back to the hom ...

Tips for arranging footer elements in a row using css/Bootstrap 4!

I'm currently working on the footer section where I've added Social Media Icons and a Contact Us section. If you want to view the layout, check out this fiddle. Right now in the fiddle, the Contact Us and Social Media Icons are displayed on sepa ...

Refresh numerous pages

Currently, I'm working on a freelance project where I've been tasked with re-coding an outdated menu for my client. The website is built on static pages, so updating the menu manually on each page seems like a time-consuming and repetitive task. ...

Is it possible to modify Bootstrap 4 variables using its own variables?

I am currently utilizing the latest Bootstrap 4 beta 2 and attempting to customize it by altering the variables to suit my preferences. Within my styles.scss file, I have included all necessary bootstrap imports: // Custom variables @import 'helpers ...

Move the close button on Bootstrap's Modal to the left side

I am currently in the process of building a new website and I am still learning HTML, CSS, and other related technologies. I am utilizing Bootstrap to assist me, but I have run into a problem. The website I am working on is in Hebrew and I am struggling to ...

Ways to individually select and activate several HTML elements with matching classes, and then apply styles to a different div featuring multiple classes using Jquery or JavaScript

Within my webpage, I have created a section with three links. Clicking on each link reveals specific content (content 1, content 2, and content 3). The issue arises when I have two identical sections (Section 1 and Section 2) and clicking on a link display ...