Bootstrap CSS Calendar align months - html

I really hope there is an easy fix for this. Basically on full screen I want two months to show in a colum, on smaller devices it shifts to 1 column (i am using .col-md-6 for this), with 3 rows total showing 6 months. This works if each div is the same size. The issue arrises when there is a month with less "blocks of days"
see here: https://www.dropbox.com/s/1rrryqzzppql858/months.png?dl=0
is there some sort of vertical-align css that can be used in bootstrap to fix this???
Here is my code:
<?php
$date = date_create("2015-01-01");
$date_end = date_create("2015-07-01");
while ($date < $date_end):?>
<div class="col-md-6 month_border">
<?php echo "<h2>".date_format($date,'F')."<small>".date_format($date,'Y')."</small></h2>"; ?>
<div class="row">
<?php
//date_format($date,'w') Day of week: 0 = Sunday
//date_format($date,'t') Number of days in current month
$weekday = date_format($date,'w');
$total_days = date_format($date,'t');
$days28 = 0;
if ($total_days == 28) {$days28 = 1;}
for ($day_block = 0 - $weekday + 1; $day_block <= $total_days + $days28; $day_block ++):?>
<?php if($day_block > 0 AND $day_block <= $total_days):?>
<div class="col-7split day_block" id="day_block-<?php echo date_format($date,'n')."-".$day_block; ?> "
data-toggle="modal" data-target="#myModal" data-whatever="#mdo">
<div class="row border bg-info">
<?php echo $day_block; ?>
</div>
<div class="row border">
<div class="col-sm-6 shift_text">
<?php if($day_block != 3) { echo "N"; } ?>
</div>
<div class="col-sm-6 compliment_text nopadding hidden-print">
</div>
</div>
<?php else:?>
<div class="col-7split day_block">
<?php endif; ?>
</div>
<?php endfor; ?>
</div>
</div>
<?php date_modify($date,"+1 months"); endwhile; ?>

Related

Make an 5 column grid in bootstrap 4 [duplicate]

This question already has answers here:
Five equal columns in twitter bootstrap
(47 answers)
Bootstrap - 5 column layout
(20 answers)
Closed 1 year ago.
I would like to put 5 columns next to each other in a .row div.
If i delete the col-sm-6 col-md-3 classes from the divs, and just give a simple .col class, nothing happens also.
I show you a photo of my source code.
If i put a .clearfix div after every 5. col div, why doesnt it works?
echo '<div class="row">';
$otodik = "";
include_once("files/show_products.php");
echo '</div>';
In a while loop:
<?php while($item = mysqli_fetch_assoc($get_items)){ if($otodik%5 == 0) { echo '<div class="clearfix"></div>'; } ?>
<div class="col-sm-6 col-md-3 text-center mb-5">
<a href="<?php echo $host; ?>/webshop/<?php echo $seolink_kat ."/". html($item['termek_seo']); ?>" class="" title="<?php echo html($item['termek_nev']); ?>">
<img data-src="https://gras.hu/images/item/<?php echo html($item['termek_thumb']).t2(); ?>" alt="<?php echo html($item['termek_nev']); ?>" class="img-fluid main_product_thumb lazyload">
</a>
<h2 class="main_item_title">
<?php echo html($item['termek_nev']); ?>
</h2>
</div>
<?php $otodik++; } ?>
<div class="clearfix"></div>
Its much simpler with bootstrap 4 as grid system now supports flexbox. You just need to add class col to every column in a row.
<div class="container">
<div class="row">
<div class="col mx-1">1</div>
<div class="col mx-1">2</div>
<div class="col mx-1">3</div>
<div class="col mx-1">4</div>
<div class="col mx-1">5</div>
</div>
</div>

Photos on website only showing in one row, I need to add multiple rows

Why is my code displaying multiple rows instead of 1?
I can upload any number of photos to my site, but it only displays 4 photos across, the 4 most recently uploaded, on the website. I want it to display 4 rows of photos, instead of 1 row.
<div class="profile_box_body">
<?php
if(!empty($RecentPhotos)){
?>
<div class="profile_photos_list row">
<?php
foreach($RecentPhotos as $value){ ?>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3 media_item block-center">
<div class="profile_photo ">
<!--<a href="javascript:void();" class="clickable" data-toggle="modal" data-target="#myModal">-->
<a href="<?=WATERMARK_FILE!=''?DisplayImageWithWatermark($value):DB_DOMAIN.'uploads/images/'. $value['bigimage']; ?>" data-fancybox="gallery<?php echo $value["aid"] ?>" >
<div class="img-container-large">
<div class="img-responsive-container img-responsive-container--border">
<img src="<?=$value['image']; ?>" class="pImageBorder img-responsive-container__img">
</div>
</div>
<div class="pImageUsername"><b><?=$value['title']; ?></b><br/><?=$value['description']; ?></div>
</a>
</div>
</div>
<?php
}
?>
</div>
<?php
}
else {
?>
<a class="" style="float: none; text-align: center" href='<?=getThePermalink('account/&dll=gallery')?>'><p> <?=$lang_register_page['a14'] ?></p></a>
<?php
}
?>
</div>
This is not a problem with your HTML or CSS. The problem is into your PHP query. You should check first that, is there a limit = 1 called into your query?

Bootstrap Woocommerce checkout columns not aligned

I've been trying to align my checkout columns side by side for hours and finally decided to swallow my pride and ask for help, I can imagine it's something pretty simple but I can not find it,
When I visit here, and add anything to cart to see the problem, the columns are not aligned side to side, just underneath each other.
Running with Bootstrap + WordPress + Woocommerce.
SCREENSHOT
https://ibb.co/bK382Z8
CODE:
<div class="">
<form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data">
<?php if ( $checkout->get_checkout_fields() ) : ?>
<?php do_action( 'woocommerce_checkout_before_customer_details' ); ?>
<div class="row" id="customer_details">
<div class="col-xs-12 col-md-6">
<div class="checkbox-form">
<?php do_action( 'woocommerce_checkout_billing' ); ?>
<?php do_action( 'woocommerce_checkout_shipping' ); ?>
</div>
</div>
<div class="col-xs-12 col-md-6">
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
<h3 id="order_review_heading"><?php _e( 'Your order', '99fy' ); ?></h3>
<?php do_action( 'woocommerce_checkout_before_order_review' ); ?>
<div id="order_review" class="woocommerce-checkout-review-order">
<?php do_action( 'woocommerce_checkout_order_review' ); ?>
</div>
<?php do_action( 'woocommerce_checkout_after_order_review' ); ?>
</div>
</div>
<?php endif; ?>
</form>
The second column that is going under is not in the row, you can see this in HTML. Add the second column inside the row and it should work.
It's roughly supposed to look like this:
<div class="row" id="customer_details">
<div class="col-xs-12 col-md-6">
<div class="checkbox-form">...</div>
</div>
<div class="col-xs-12 col-md-6">
<h3 id="order_review_heading">Your order</h3>
<div id="order_review" class="woocommerce-checkout-review-order">...</div>
</div>
</div>

Creating columns in bootstrap

EDIT: I realized I was putting dots in front of classes. Please stop downvoting.
I'm trying to create columns in my search results. I want the results to appear in columns of 3.
This is my code:
<div class=".container">
<div class=".row">
<div class=".col-xs-3">
<h2><?php the_title(); ?></h2>
<?php
if ( has_post_thumbnail() ) {
echo '<p>';
the_post_thumbnail("small");
echo '</p>';
}
?>
<p><br /><?php the_excerpt(); ?><p>
</div>
</div>
</div>
Nothing happening.
Classes found at: http://tomasjanecek.cz/en/clanky/post/list-of-bootstrap-3-css-classes-with-description
CSS class selectors begin with a . character.
HTML class names do not (well, they can, but it is more trouble than it is worth and the Bootstrap CSS doesn't expect them to).
<div class="container">
<div class="row">
<div class="col-xs-3">
Don't use . character inside HTML tags classes
Try this code:
<div class="container">
<div class="row">
<div class="col-xs-3">
<h2><?php the_title(); ?></h2>
<?php
if ( has_post_thumbnail() ) {
echo '<p>';
the_post_thumbnail("small");
echo '</p>';
}
?>
<p><br /><?php the_excerpt(); ?><p>
</div>
</div>

Bootstrap Columns On Top Of Each Other on Mobile

I'm working on hhttp://pizzli.com/ephraimwp/employers/. When I view it on mobile, the two items in the sidebar overlap each other. Currently, I have the column nested within another column. Please see my code below and try viewing it on mobile:
<div class="row" style="padding-top:35px;">
<div class="col-md-4" style="padding-left:0px;">
<div id="innernav">
<?php
$cat = get_field("sidebar_category");
if ($cat == 3){
echo wp_nav_menu(array('theme_location'=>'aboutus'));
}
elseif ($cat == 6){
echo wp_nav_menu(array('theme_location'=>'employees'));
}
elseif ($cat ==5){
echo wp_nav_menu(array('theme_location'=>'employers'));
}
elseif ($cat == 4){
echo wp_nav_menu(array('theme_location'=>'ourservices'));
}
?>
</div>
<div class="col-md-4" style="padding-left:0px;">
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Inner Page 1 Left Sidebar')) : ?>
<?php endif; ?>
</div>
</div>
<div class="col-md-8">
<h2 class="titlehead"><?php the_title();?></h2>
<div style="color:#a2a2a2;font-size:18px;">
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
the_content();
} // end while
} // end if
?>
</div>
</div>
</div>
</div>
try adding a .col class to #innernav (col-md-8). I am just guessing the answer because you didn't provide a fiddle or bootply. it will be great if you can provide a fiddle for your question.