removing space b/w two columns Bootstrap - css

Hi I am trying to make less space b/w the two images but I am unable to do so. when I add any css rule such as margin it breaks the columns. so what is the best way I can get images a bit closer to each other.
my site link: http://www.abiglittlebiz.com/trevelle/display-centres/
here is my code:
<div class="displaycenter">
<h2 class="displayh1"><?php echo "$main_heading";?></h2>
<div class="container">
<div class="row">
<div class="col-md-8">
<h2 class="displayh2"><?php echo "$display_heading";?></h2>
<div>
<?php if(!empty($ascot_image) ): ?>
<img src="<?php echo $ascot_image['url']; ?>" alt="<?php echo $ascot_image['alt']; ?>">
<?php endif; ?>
<div class="caption checkout-caption">
<h3 id="newpro"><?php echo "$ascot_text"; ?></h3>
<p class="details"><?php echo "$displaycenter1";?></p>
</div>
</div>
</div>
<div class="col-md-4">
<h2 class="displayh2"><?php echo "$display_heading2";?></h2>
<div>
<?php if(!empty($liberty_image) ): ?>
<img src="<?php echo $liberty_image['url']; ?>" alt="<?php echo $liberty_image['alt']; ?>">
<?php endif; ?>
<div class="caption checkout-caption">
<h3 id="newpro"><?php echo "$liberty_text"; ?></h3>
<p class="details"><?php echo "$displaycenter2";?></p>
</div>
</div>
</div>
<div class="col-md-8">
<div>
<?php if(!empty($alfa_image) ): ?>
<img src="<?php echo $alfa_image['url']; ?>" alt="<?php echo $alfa_image['alt']; ?>">
<?php endif; ?>
<div class="caption checkout-caption">
<h3 id="newpro"><?php echo "$alfa_text"; ?></h3>
<p class="details"><?php echo "$displaycenter3";?></p>
</div>
</div>
</div>
<div class="col-md-4">
<div>
<?php if(!empty($odyssey_image) ): ?>
<img src="<?php echo $odyssey_image['url']; ?>" alt="<?php echo $odyssey_image['alt']; ?>">
<?php endif; ?>
<div class="caption checkout-caption">
<h3 id="newpro"><?php echo "$odyessy_text"; ?></h3>
<p class="details"><?php echo "$displaycenter4";?></p>
</div>
</div>
</div>
<div id="cs">
<h2 class="displayh1" id="cl"><?php echo "$second_heading";?></h2>
<div class="col-md-8">
<div>
<?php if(!empty($monte_image) ): ?>
<img src="<?php echo $monte_image['url']; ?>" alt="<?php echo $monte_image['alt']; ?>">
<?php endif; ?>
<div class="caption checkout-caption">
<h3 id="newpro"><?php echo "$monte_text"; ?></h3>
<p class="details"><?php echo "$displaycenter5";?></p>
</div>
</div>
</div>
<div class="col-md-4">
<div>
<?php if(!empty($lot_image) ): ?>
<img src="<?php echo $lot_image['url']; ?>" alt="<?php echo $lot_image['alt']; ?>">
<?php endif; ?>
<div class="caption checkout-caption">
<h3 id="newpro"><?php echo "$monte_text"; ?></h3>
<p class="details"><?php echo "$displaycenter6";?></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>

You are using a col-md-8 class for the left column and a col-md-4 class for the right one. Why not make them both col-md-6 and apply the following CSS?
.row .col-md-6:first-of-type {
text-align: right;
}
This right aligns the content in the left column and eliminates most of the gap between columns. You'll probably have to play around with more CSS to polish things further, but this should give you a decent start.

Related

While implementing this code on my wp-admin the content is okay but in the customers views the slider is not okay and the image is strechd/ distorted

/img/scrubber-pov.png" id="pov-robot" alt="Robot Perspective" />
" style="background: url();">
/img/scrubber-pov.png" class="inside-slide-robot" alt="Robot Perspective" />
<?php if( have_rows('technology_slides') ):?>
<div class="mobile-slider-presentation">
<?php $slide_count = 1;
while( have_rows('technology_slides') ): the_row();
$slide_background = get_sub_field('slide_background');
$slide_content = get_sub_field('slide_content');?>
<div class="slide-background" id="slideNumber-<?php echo $slide_count;?>" style="background: url(<?php echo $slide_background['url'];?>);">
<div class="container-fluid content-container">
<div class="row">
<div class="col-xl-4 offset-xl-8">
<div class="slide-copy">
<?php echo $slide_content;?>
</div>
</div>
</div>
<img src="<?php bloginfo('template_url'); ?>/img/scrubber-pov.png" class="inside-slide-robot" alt="Robot Perspective" />
</div>
</div>
<?php $slide_count = $slide_count + 1;?>
<?php endwhile; reset_rows();?>
</div>
<?php endif; ?>
/img/scrubber-pov.png" id="pov-robot" alt="Robot Perspective" />

Wordpress Page not loading correct with Stylepath

I have got an error in my code and I cant find why and where it orginates. But I know the template isnt loading correct. I believe the problem could start in the code below.
The problem started when I changed echo site_url to echo get_post_type_archive_link.
single-event.php
<?php
get_header();
while(have_posts()) {
the_post(); ?>
<div class="page-banner">
<div class="page-banner__bg-image" style="background-image: url(<?php echo get_theme_file_uri('/images/ocean.jpg') ?>)"></div>
<div class="page-banner__content container container--narrow">
<h1 class="page-banner__title"><?php the_title();?></h1>
<div class="page-banner__intro">
<p>DONT FORGETT TO REPLACE ME LATER!!</p>
</div>
</div>
</div>
<div class="container container--narrow page-section">
<div class="metabox metabox--position-up metabox--with-home-link">
<p>
<a class="metabox__blog-home-link" href="<?php echo site_url('/blog'); ?>">
<i class="fa fa-home" aria-hidden="true"></i> Events Home</a>
<span class="metabox__main"><?php the_title(); ?></span>
</p>
</div>
<div class="generic-content"><?php the_content();?></div>
<h2>
<?php }
get_footer();
?>
single.php
<?php
get_header();
while(have_posts()) {
the_post(); ?>
<div class="page-banner">
<div class="page-banner__bg-image" style="background-image: url(<?php echo get_theme_file_uri('/images/ocean.jpg') ?>)"></div>
<div class="page-banner__content container container--narrow">
<h1 class="page-banner__title"><?php the_title();?></h1>
<div class="page-banner__intro">
<p>DONT FORGETT TO REPLACE ME LATER!!</p>
</div>
</div>
</div>
<div class="container container--narrow page-section">
<div class="metabox metabox--position-up metabox--with-home-link">
<p>
<a class="metabox__blog-home-link" href="<?php echo get_post_type_archive_link('event'); ?>">
<i class="fa fa-home" aria-hidden="true"></i> Blog Home</a>
<span class="metabox__main">Posted by <?php the_author_posts_link(); ?> on <?php the_time('n.j.y'); ?> in <?php echo get_the_category_list(', '); ?></span>
</p>
</div>
<div class="generic-content"><?php the_content();?></div>
<h2>
<?php }
get_footer();
?>
Error message:

<?php wp_link_pages(); ?> is working on posts but not on pages to display pagination

I created a theme from scratch and have pagination working on the post pages using , it's working on single.php.
<?php get_header(); ?>
<?php
while(have_posts()) {
the_post();
?>
<div class="mainConent">
<div class="leftSidebar">
<div class="sidebarTitleWrapper">
<?php dynamic_sidebar('left_sidebar') ?>
</div>
</div>
<div class="recentBlogsWrapper">
<div class="blogWrapper">
<h2><?php the_title(); ?></h2>
<p><?php the_time('F j, Y') ?></p>
<?php if(has_post_thumbnail()) { ?>
<div class="card-image">
<img class="page-image" src="<?php echo get_the_post_thumbnail_url(get_the_ID()); ?>" alt="Card Image">
</div>
<?php } ?>
<div class="card-description">
<?php the_content(); ?>
<?php wp_link_pages(); ?>
<?php comments_template(); ?>
<?php } ?>
<div class="backarrowwrap">
<a class="backhomelink" href="<?php echo site_url(); ?>" <?php if(is_front_page()) echo 'class="active"' ?>>
<img class="backarrow" src="<?php echo get_template_directory_uri(); ?>/img/backarrow.png" alt="back arrow" />
Go Back Home
</a>
</div>
</div>
</div>
</div>
<div class="rightSidebar" id="sidebar">
<div class="sidebarTitleWrapper">
<?php dynamic_sidebar('right_sidebar') ?>
</div>
</div>
I put it right below the_content(); and it's working exactly like I want it to. However, it's not working on page.php, even though it's in the same place on the page.
<?php get_header();
while(have_posts()) {
the_post();
?>
<div class="pageWrapper">
<h2><?php the_title(); ?></h2>
<?php if(has_post_thumbnail()) { ?>
<div class="card-image">
<img class="page-image" src="<?php echo get_the_post_thumbnail_url(get_the_ID()); ?>" alt="Card Image">
</div>
<?php } ?>
<div class="card-description">
<?php the_content(); ?>
<?php wp_link_pages(); ?>
<?php } ?>
</div>
</div>
<?php get_footer(); ?>
I've included the
<!–-nextpage-–>
code in one of my pages just like I did for the blogs, but it's not paginating between the paragraphs.
What am I doing wrong?
You need at least one <!--nextpage-->, if the content of a page (or post) has at least one <!--nextpage--> tag (and this code is in The Loop), this prints linked page numbers (“Pages: 1 2 3 4 and so on...”), without a link on current page number, and by default within tags:.

dynamic row is being disturbed by height increase of first div of md-6

I am making dynamic div of class row divided by two div of md-6 as expected my result is coming when first div height is small but if it is not the third and forth div position is disturbed
kindly check screen shots in
https://screenshots.firefox.com/Pg5ACKyMlWCQVYx1/localhost
as in screen shot reviews under date 2017-10-25 is my desired result but the above reviews are mess
my code is
<?php
while($row = $getdate->fetch_assoc())
{
$date = $row['DATE(reviews_date)'];
$getdatedata = $user->getdatedata($date);
?>
<h4 class="hdg" style="color:#212121;"> <?php echo $date ;?></h4>
<hr style="height:1px;border:none;background-color:#333;" />
<div class = "row">
<?php
while($rowdata = $getdatedata->fetch_assoc())
{
?>
<div class="col-md-6" style="position: relative;">
<p>Review # <?php echo $rowdata['reviews_id']; ?>
</p>
<p>
Written by <?php echo $rowdata['reviews_by']; ?> after counseling with <?php echo $rowdata['reviews_to']; ?> for <?php echo $rowdata['duration'];?> on issues concerning <?php echo $rowdata['issue']; ?> .
</p>
<br>
<h5 style="color:#212121;"">
<?php echo $rowdata['reviews_body'];?>
</h5>
<br>
<div class="w3_agileits_services_grid1">
<div class="w3_agileits_services_grid1l">
<img src="<?php echo $rowdata['coun_image']; ?>" alt=" " class="img-responsive" />
</div>
<div class="name">
<ul>
<li> <?php echo $rowdata['reviews_to']; ?> </li>
</ul>
<ul>
<li><?php echo $rowdata['coun_degree'];?> </li>
</ul>
</div>
</div>
<hr style="height:1px;border:none;background-color:#333;width:550px;margin-top:100px;">
</div>
<?php
}
?>
</div>
<br>
<?php
} ?>
enter code here

Wordpress - Advanced Custom Fields gallery

I'm using ACF plugin and i create a flexible content to show title, content and gallery but i can't get the images.
My code is this:
<div id="services-pages">
<?php
if( have_rows('serviços') ):
while ( have_rows('serviços') ) : the_row();
?>
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-6">
<div class="content">
<div class="title">
<hr>
<span><?php echo the_sub_field('title');?></span>
</div>
<div class="info">
<p><?php echo the_sub_field('content');?></p>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6">
<div class="row images">
<?php
$images = the_sub_field('images');
var_dump($images);
?>
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="slider-service-element">
<?php foreach( $images as $image ): ?>
<div>
<img src="<?php echo $image['url']; ?>" />
</div>
<?php endforeach; ?>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="slider-service-main">
<?php foreach( $images as $image ): ?>
<div>
<img src="<?php echo $image['url']; ?>" />
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
endwhile;
else :
?>
<div>
<span>no records</span>
</div>
<?php
endif;
?>
</div>
My ACF field:
I already try to get gallery with get_field() and the_sub_field().
How can i solve that?
Thank you.
Try something like this
$images = get_sub_field('images');
if( $images ):
foreach( $images as $image ):
?><img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" /><?php
endforeach;
endif;
There's a post on acf forum about it
https://support.advancedcustomfields.com/forums/topic/gallery-field-within-a-repeater-field/
<?php if( have_rows('glp_images') ):
// loop through the rows of data
while ( have_rows('glp_images') ) : the_row();
$images = get_sub_field('glp_img');
if( $images ): ?>
<?php foreach( $images as $image ): ?>
<div>
<img src="<?php echo $image; ?>" alt="" />
</div>
<?php endforeach; endif;?>
<?php endwhile; endif; ?>

Resources