php - Align sidebar with my main content bootstrap -


I am using Bootstrap and WordPress to create a website. I have my main content which is 8 columns and then my sidebar is 4. On my normal pages I put them in a row, so that they are correctly aligned, although with this page, I used WordPress Loop to create several rows with content, that means that my sidebar is in my It is not in the same line of content and it is pushed down on the screen. Is it possible to align them horizontally?

Here's the code I'm using.

  & lt ;? Php if ($ wp_query-> has_posts ()): while ($ wp_query-> is_pos ()): $ wp_query- & gt; The_post (); ? & Gt; & Lt; Div class = "line case study" & gt; & Lt; Div id = "page_content" & gt; & Lt; Div class = "col-md-8" & gt; & Lt; Div class = "case_summary_image col-md-4" & gt; & Lt; A href = "& lt ;? php the_permalink () ;? & gt;" & Gt; & Lt ;? Php the_post_ thumbnail ('CaseStudy IMG-Responsive') ;? & Gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; Div class = "case_summary col-md-8" & gt; & Lt; / A & gt; & Lt; One style = "font-size: 18px; line-height: 30px; color: # 666666; font-weight: bold; text-decoration: any" href = "& lt; php the_ermelink () ;? & gt;" & Gt; & Lt ;? Php the_title (); ? & Gt; & Lt; / A & gt; & Lt ;? Php the_excerpt (); ? & Gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt ;! - Sidebar - & gt; & Lt ;? Php timeline; end if; ? & Gt; & Lt; Div class = "col-md-4" & gt; & Lt ;? Php get_sidebar () ;? & Gt; & Lt; / Div & gt;  

You can still use a container or a Row is required for the job you want them to do.


Comments