jquery - Attempting to get columns to sit side by side CSS Bootstrap -
I am creating a website on WordPress using the Twitter Bootstrap framework.
I have a loop that goes through my case study and prints them on the page in 8 column wide space, so I try to put my sidebar next to these case studies with width 4 I do But it just push my sidebar in the lower part of the page. The only solution I have found is to give a negative margin, doing this, the background image separates from other pages, so it can not be used.
This is my code which generates case studies and then generates my sidebar.
Thank you!
& lt ;? Php if ($ wp_query -> is_pause ()): while ($ wp_query-> is_pos ()): $ wp_query- & gt; The_post (); ? & Gt; & Lt; Div class = "line case-study-block" & 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; row-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; P & gt; & Lt ;? Php the_excerpt (); ? & Gt; & Lt; / P & 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 = "clear" & gt; & Lt; / Div & gt; & Lt; Div class = "row" & gt; & Lt; Div id = "page_content" & gt; & Lt; Div class = "col-md-4 pull-right" & gt; & Lt ;? Php get_sidebar ('case') ;? & Gt; & Lt; / Div & gt;
It seems to me that your html structure is incorrect for bootstrap, of this structure Try:
& lt; Div class = "container" & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-md-8" & gt; & Lt; Div class = "row" & gt; & Lt ;! - WP Post Loop - & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "col-md-4" & gt; & Lt ;? Php get_sidebar ('case') ;? & Gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; With this you have the ID page_content twice the ID must be unique!
And if you want the nest col-xx-xx in the other col-xx-xx (like you do your case-study- In the block loop), you need to wrap a new .row inside the call first. Read more about this here:
Comments
Post a Comment