Bootstrap carousel shows enlarged images on iphone - css

I would be really appreciate if you can help me with the next issue.
I have template with Bootstrap carousel on the frontpage. Size of the images shows ok on the laptop, but when I open it in Iphone - images still big and it looks like enlarged picture. http://c2n.me/itAJbn.jpg
Css code is
#main-slider {
position: relative;
}
#main-slider .carousel h2 {
}
#main-slider .carousel .btn {
border: 3px solid rgba(255, 255, 255, 0.5);
color: #fff;
border-radius: 5px;
float: right;
margin-top: -25px;
}
#main-slider .carousel .btn:hover {
background-color: rgba(255, 255, 255, 0.3);
}
#main-slider .carousel .boxed {
padding: 10px 15px;
background-color: rgba(0, 0, 0, 0.8);
display: inline-block;
}
#main-slider .carousel .item {
background-position: 50%;
background-repeat: no-repeat;
background-size: cover;
left: 0 !important;
opacity: 0;
top: 0;
position: absolute;
width: 100%;
min-height: 650px;
display: block !important;
-webkit-transition: opacity ease-in-out 600ms;
-moz-transition: opacity ease-in-out 600ms;
-o-transition: opacity ease-in-out 600ms;
transition: opacity ease-in-out 600ms;
}
#main-slider .carousel .item:first-child {
top: auto;`enter code here`
position: relative;
html
<?php
$args = array( 'post_type'=>'zee_slider', 'orderby' => 'menu_order','order' => 'ASC' );
$sliders = get_posts( $args );
$total_sliders = count($sliders);
?>
<section id="main-slider" style="margin: 0; padding: 0;">
<div class="carousel slide wet-asphalt" data-ride="carousel">
<ol class="carousel-indicators">
<?php for($i = 0; $i<$total_sliders; $i++){ ?>
<li data-target="#main-slider" data-slide-to="<?php echo $i ?>" class="<?php echo ($i==0)?'active':'' ?>"></li>
<?php } ?>
</ol>
<div class="carousel-inner">
<?php foreach ($sliders as $key => $slider) {
$full_img = wp_get_attachment_image_src( get_post_thumbnail_id( $slider->ID ), 'full');
$slider_position = get_post_meta($slider->ID, 'slider_position', true );
$boxed = (get_post_meta($slider->ID, 'slider_boxed', true )=='yes') ? 'boxed' : '';
$has_button = (get_post_meta($slider->ID, 'slider_button_text', true )=='') ? false : true;
$button = get_post_meta($slider->ID, 'slider_button_text', true );
$button_url = get_post_meta($slider->ID, 'slider_button_url', true );
$video_url = get_post_meta($slider->ID, 'slider_video_link', true );
$video_type = get_post_meta($slider->ID, 'slider_video_type', true );
$bg_image_url = get_post_meta($slider->ID, 'slider_background_image', true );
$background_image = 'background-image: url('.wp_get_attachment_url($bg_image_url).')';
$columns = false;
if( !empty($image_url) or !empty($video_url) ){
$columns = true;
}
if( $video_type=='youtube' ) {
$embed_code = '<iframe width="640" height="480" src="//www.youtube.com/embed/' . get_video_ID( $video_url ) . '?rel=0" frameborder="0" allowfullscreen></iframe>';
} elseif( $video_type=='vimeo' ) {
$embed_code = '<iframe src="//player.vimeo.com/video/' . get_video_ID( $video_url ) . '?title=0&byline=0&portrait=0&color=a22c2f" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>';
}
if( $full_img ){
$embed_code = '<img src="' . $full_img[0] . '" alt="">';
$columns = true;
}
?>
<div class="item <?php echo ($key==0) ? 'active' : '' ?>" style="<?php echo ( $bg_image_url ) ? $background_image : '' ?>">
<div class="container">
<div class="row">
<div class="<?php echo ($columns) ? 'col-sm-6' : 'col-sm-12' ?>">
<div class="carousel-content centered <?php echo $slider_position ?> " >
<h2 class="<?php echo $boxed ?> animation animated-item-1">
<?php echo $slider->post_title ?>
</h2>
<p class="<?php echo $boxed ?> animation animated-item-2">
<?php echo do_shortcode( $slider->post_content ) ?>
</p>
<?php if( $has_button ){ ?>
<a class="btn btn-md animation animated-item-3" href="<?php echo $button_url ?>"><?php echo $button ?></a>
<?php } ?>
</div>
</div>
<?php if($columns){ ?>
<div class="col-sm-6 hidden-xs animation animated-item-4">
<div class="centered" style="margin-top: 129px;">
<div class="embed-container">
<?php echo $embed_code; ?>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</div><!--/.item-->
<?php } // endforeach ?>
</div><!--/.carousel-inner-->
</div><!--/.carousel-->
<a class="prev hidden-xs" href="#main-slider" data-slide="prev">
<i class="icon-angle-left"></i>
</a>
<a class="next hidden-xs" href="#main-slider" data-slide="next">
<i class="icon-angle-right"></i>
</a>
</section>

Related

How can I make my flex-box buttons hover?

I have a flex box with several different buttons, namely, "Shop My Look," social icons, and a comment icon. I'd like them to hover to backgound-color: #ffff; (font) color: #f37761; and border color: #f37761. Applying the :hover doesn't do anything. Any thoughts?
You can find my issue on here: www.rachelclayton.co. It's on the homepage under each post in the post-meta area.
/* HTML */
<?php if(!is_single()) : ?>
<div class="read-more">
<?php esc_html_e( 'Continue Reading', 'alder' ); ?> <i class="fa fa-angle-right" aria-hidden="true"></i>
</div>
<div class="shop-social">
<div class="shop-my-look">
<?php esc_html_e( 'Shop My Look', 'alder' ); ?>
</div>
<?php if(!get_theme_mod('alder_post_share')) : ?>
<div class="post-share">
<a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>"><i class="fa fa-facebook"></i></a>
<a target="_blank" href="https://twitter.com/intent/tweet?text=Check%20out%20this%20article:%20<?php print alder_social_title( get_the_title() ); ?>&url=<?php echo urlencode(the_permalink()); ?><?php if(get_theme_mod('alder_twitter')) : ?>&via=<?php echo esc_html(get_theme_mod('alder_twitter')); ?><?php endif; ?>"><i class="fa fa-twitter"></i></a>
<?php $pin_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID)); ?>
<a data-pin-do="none" target="_blank" href="https://pinterest.com/pin/create/button/?url=<?php echo urlencode(the_permalink()); ?>&media=<?php echo esc_url($pin_image); ?>&description=<?php print alder_social_title( get_the_title() ); ?>"><i class="fa fa-pinterest"></i></a>
</div>
<?php endif; ?>
<?php if(!get_theme_mod('alder_post_comment_link')) : ?>
<div class="meta-comment">
<i class="fa fa-comment"></i>
</div>
<?php endif; ?>
</div>
<?php else : ?>
<?php if(!get_theme_mod('alder_post_share_author')) : ?>
<div class="meta-author">
<?php echo get_avatar( get_the_author_meta('email'), '60' ); ?><span class="by"><?php esc_html_e( 'by', 'alder' ); ?></span> <span class="vcard author"><span class="fn"><?php the_author_posts_link(); ?></span></span>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
<?php if(!get_theme_mod('alder_post_related')) : ?>
<?php if(is_single()) : ?>
<?php get_template_part('inc/templates/post-related'); ?>
<?php endif; ?>
<?php endif; ?>
<?php comments_template( '', true ); ?>
<?php if(!get_theme_mod('alder_post_pagination_hide')) : ?>
<?php if(is_single()) : ?>
<?php get_template_part('inc/templates/post-pagination'); ?>
<?php endif; ?>
<?php endif; ?>
</article>
</div>
/* CSS */
}
.post-meta .shop-social {
display: flex;
clear: both;
}
.post-meta .shop-social .post-share a,
.post-meta .shop-social .meta-comment a {
margin-left: 10px;
}
.post-meta .shop-social .shop-my-look,
.post-meta .shop-social .post-share,
.post-meta .shop-social .meta-comment {
display: contents;
}
.post-meta .shop-social .shop-my-look a {
flex-grow: 3;
}
.post-meta .shop-social a {
background: #ffff;
border: 1px solid #dfdfdf;
color: #2e2e2e;
display: block;
font-size: 11.5px;
font-weight: 400;
height: 40px;
letter-spacing: 2px;
line-height: 40px;
width: 4em;
padding: 0 18px;
text-align: center;
text-transform: uppercase;
}
.post-meta .shop-my-look a {
font-size: 11px;
}
.post-meta .shop-social: hover {
background: #ffff;
border: 1px solid #eee;
color: #f37761;
}
In your CSS you have a space between the : and hover. This would cause the hover not to work.
I added hover through console and it works fine
.shop-my-look a:hover {
backgound-color: #ffff;
color: #f37761;
border color: #f37761.
}

How to limit a user description to a certain amount of characters in a user list?

I'm changing the layout of my "users" page in a Wordpress website here
I would like to limit the numbers of characters of the description to a certain amount, in order to "equalize" the bio of each author (user).
Is it possible?
Here the template code:
<?php
/*
Template Name: Display Contributors and Authors
*/
$args = array(
'role' => 'contributor',
'orderby' => 'post_count',
'order' => 'DESC'
);
$contributors = get_users( $args );
?>
<?php get_header();?>
<div id="main">
<div id="primary" class="three-parts archive">
<div class="widget-title">
<?php the_title(); ?>
</div>
<div id="blog-list" class="blog-category">
<ul>
<?php
foreach($contributors as $contributor)
{
?>
<li style="margin-top: 10px; width:25%;">
<div class="blog-post-image">
<div class="image_fx5">
<a href=<?php echo get_author_posts_url( $contributor->ID ); ?>><?php echo get_avatar( $contributor->user_email, '128' ); ?></a>
</div>
</div>
<!--author-image-->
<div class="blog-post-title-box">
<div class="blog-post-title">
<h2>
<a href=<?php echo get_author_posts_url( $contributor->ID ); ?>><?php echo $contributor->display_name; ?></a>
</h2>
</div>
</div>
<!--author-name-->
<div class="blog-post-content" style="padding-bottom: 0px; text-align: justify;">
<?php echo $contributor->description; ?>
</div>
<div id="author-info" style="margin-top: 0px; padding-left: 0px; padding-right: 0px; border-bottom-width: 0px;">
<div id="author-desc" style="width: 100%;">
<ul class="author-social" style="padding-top: 0px;">
<?php if($contributor->facebook) { ?>
<li style="
margin-top: 0px;
padding-left: 0px;
padding-right: 0px;
height: 25px;
">
<a href="http://facebook.com/<?php echo $contributor->facebook; ?>" class="fb-social-icon" target="_blank">
</a>
</li>
<?php } ?>
<?php if($contributor->twitter) { ?>
<li style="
margin-top: 0px;
padding-left: 0px;
padding-right: 0px;
height: 25px;
">
<a href="https://twitter.com/<?php echo $contributor->twitter; ?>" class="twitter-social-icon" target="_blank">
</a>
</li>
<?php } ?>
<?php if($contributor->google) { ?>
<li style="
margin-top: 0px;
padding-left: 0px;
padding-right: 0px;
height: 25px;
">
<a href="http://plus.google.com/<?php echo $contributor->google; ?>?rel=author" class="google-social-icon" target="_blank">
</a>
</li>
<?php } ?>
<?php if($contributor->pinterest) { ?>
<li style="
margin-top: 0px;
padding-left: 0px;
padding-right: 0px;
height: 25px;
">
<a href="http://www.pinterest.com/<?php echo $contributor->pinterest; ?>?rel=author" class="pinterest-social-icon" target="_blank">
</a>
</li>
<?php } ?>
<?php if($contributor->instagram) { ?>
<li style="
margin-top: 0px;
padding-left: 0px;
padding-right: 0px;
height: 25px;
">
<a href="http://www.instagram.com/<?php echo $contributor->instagram; ?>?rel=author" class="instagram-social-icon" target="_blank">
</a>
</li>
<?php } ?>
</ul>
</div>
</div>
<!--author-desc-->
</li>
<?php } ?>
</ul>
</div>
</div>
<!--primary-->
<div id="secondary">
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Category Sidebar')): endif; ?>
</div>
<!--secondary-->
</div>
<!--main-->
<?php get_footer(); ?>
Assuming you mean the description try...
<?php echo substr($contributor->description, 0, strpos($contributor->description, ' ', 150)); ?>
Which will return 150 (you can change this to what you like) characters and also make sure it finishes the last word as well.

Cross browser kerning properly technique

I have a situation trying to implement into the <header>, a logotext using kerning technique, desk cross-browsers compatible.
Beginning with this simple but very handy tool made by Mr.Andrew (special thanks), I have found a solution.
Before the modification, I had this <header> section in header.php:
...
<!-- Start Header -->
<header class="header row no-padding <?php echo $header_style; ?>" data-equal=">.columns" role="banner">
<div class="small-7 medium-4 columns logo<?php if ($header_style == 'style1') { ?> show-for-large-up<?php } ?>">
<?php if ($header_style == 'style2') { ?>
<a class="logotext" href="<?php echo esc_url( home_url( '/' ) ); ?>"
title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"
rel="home"><?php bloginfo( 'name' ); ?>
</a>
<?php } ?>
</div>
<?php if ($header_style != 'style2') { ?>
<div class="small-7 medium-4 columns logo">
<?php if ($header_style == 'style1') { ?>
<a class="logotext" href="<?php echo esc_url( home_url( '/' ) ); ?>"
title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"
rel="home"><?php bloginfo( 'name' ); ?>
</a>
<?php } ?>
</div>
<?php } ?>
<div class="small-5 <?php if ($header_style == 'style2') { echo 'medium-8'; } else { echo 'medium-4';} ?> columns menu-holder">
<?php $full_menu_true = ($menu_mobile_toggle_view == 'style2' && $header_style == 'style2');?>
<?php if ($full_menu_true) { ?>
<nav id="full-menu" role="navigation">
<?php if ($page_menu) { ?>
<?php wp_nav_menu( array( 'menu' => $page_menu, 'depth' => 2, 'container' => false, 'menu_class' => 'full-menu', 'walker' => new thb_mobileDropdown ) ); ?>
<?php } else if(has_nav_menu('nav-menu')) { ?>
<?php wp_nav_menu( array( 'theme_location' => 'nav-menu', 'depth' => 2, 'container' => false, 'menu_class' => 'full-menu', 'walker' => new thb_mobileDropdown ) ); ?>
<?php } else { ?>
<ul class="full-menu">
<li>Please assign a menu from Appearance -> Menus</li>
</ul>
<?php } ?>
</nav>
<?php } ?>
<?php if ($header_search != 'off') { do_action( 'thb_quick_search' ); } ?>
<?php if ($header_cart != 'off') { do_action( 'thb_quick_cart' ); } ?>
<a href="#" data-target="open-menu" class="mobile-toggle<?php if (!$full_menu_true) { ?> always<?php } ?>">
<div>
<span></span><span></span><span></span>
</div>
</a>
</div>
</header>
<!-- End Header -->
...
After:
...
<!-- Start Header -->
<header class="header row no-padding <?php echo $header_style; ?>" data-equal=">.columns" role="banner">
<div class="row max_width ">
<div class="small-7 medium-4 columns logo<?php if ($header_style == 'style1') { ?> show-for-large-up<?php } ?>">
<?php if ($header_style == 'style2') { ?>
<div class="small-7 medium-4 columns logo">
<span class="logotext-n">n</span>
<span class="logotext-e">e</span>
<span class="logotext-u">u</span>
<span class="logotext-e2">e</span>
<span class="logotext-g">g</span>
<span class="logotext-r">r</span>
<span class="logotext-i">i</span>
<span class="logotext-d">d</span>
</div>
<?php } ?>
</div>
</div>
<?php if ($header_style != 'style2') { ?>
<div class="row max_width ">
<div class="small-7 medium-4 columns logo">
<?php if ($header_style == 'style1') { ?>
<div class="small-7 medium-4 columns logo">
<span class="logotext-n">n</span>
<span class="logotext-e">e</span>
<span class="logotext-u">u</span>
<span class="logotext-e2">e</span>
<span class="logotext-g">g</span>
<span class="logotext-r">r</span>
<span class="logotext-i">i</span>
<span class="logotext-d">d</span>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
<div class="row max_width ">
<div class="small-5 <?php if ($header_style == 'style2') { echo 'medium-8'; } else { echo 'medium-4';} ?> columns menu-holder">
<?php $full_menu_true = ($menu_mobile_toggle_view == 'style2' && $header_style == 'style2');?>
<?php if ($full_menu_true) { ?>
<nav id="full-menu" role="navigation">
<?php if ($page_menu) { ?>
<?php wp_nav_menu( array( 'menu' => $page_menu, 'depth' => 2, 'container' => false, 'menu_class' => 'full-menu', 'walker' => new thb_mobileDropdown ) ); ?>
<?php } else if(has_nav_menu('nav-menu')) { ?>
<?php wp_nav_menu( array( 'theme_location' => 'nav-menu', 'depth' => 2, 'container' => false, 'menu_class' => 'full-menu', 'walker' => new thb_mobileDropdown ) ); ?>
<?php } else { ?>
<ul class="full-menu">
<li>Please assign a menu from Appearance -> Menus</li>
</ul>
<?php } ?>
</nav>
<?php } ?>
<?php if ($header_search != 'off') { do_action( 'thb_quick_search' ); } ?>
<?php if ($header_cart != 'off') { do_action( 'thb_quick_cart' ); } ?>
<a href="#" data-target="open-menu" class="mobile-toggle<?php if (!$full_menu_true) { ?> always<?php } ?>">
<div>
<span></span><span></span><span></span>
</div>
</a>
</div>
</div>
</header>
<!-- End Header -->
...
the css code:
...
.logotext-n {
color: #f1ecd6;
font-family: "arial black", sans-serif;
font-weight: 900;
font-size: 210px;
text-transform: lowercase;
letter-spacing: -29px;
}
.
.
.
.logotext-d {
color: #f1ecd6;
font-family: "arial black", sans-serif;
font-weight: 900;
font-size: 210px;
text-transform: lowercase;
letter-spacing: 0;
}
...
At this point I've found that kerning values looks different in IE/Firefox vs. Chrome. I've read about the Media Query and I've tried this for Chrome values display correction:
...
#media screen and (-webkit-min-device-pixel-ratio:0) {
.logotext-n {
color: #f1ecd6;
font-family: "arial black", sans-serif;
font-weight: 900;
font-size: 210px;
text-transform: lowercase;
letter-spacing: -18px;
}
}
.
.
.
#media screen and (-webkit-min-device-pixel-ratio:0) {
.logotext-d {
color: #f1ecd6;
font-family: "arial black", sans-serif;
font-weight: 900;
font-size: 210px;
text-transform: lowercase;
letter-spacing: 0;
}
}
...
The result looks as it should in every browser IE11/Firefox38.0.5/Chrome43.0.2357.124 m, Also I dont have any error in the Chrome console, nevertheless:
Being a noob in coding stuff, is this a good kerning technique for cross browser support or is there any other alternative to apply the Media Query or other conditions in a direct / short way? Thank you,
There's a CSS font-kerning property. No need to separate your logo-text into an element for each letter.
If you need custom kerning, you can make all your letter spans have position: relative and use CSS to move them left or right.

How to use CSS to make block center or take up full width

I have a lot of small sections generate via php. They are different sizes. I want though that there is a text button on the bottom that will take up the full width.
I first had
display: block;
float: left;
But it was to much to the left, I then tried:
display: inline-block
But it was too small and there was extra space on either side. Here is a screenshot of it with the extra space. Any suggestions? I am working on the buy now button.
PHP Generate code
global $wpdb;
$cat= $_POST['cat'];
if($cat=='All')
{
$items = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'afp_items ORDER BY item_id ASC');
}else
{
$items = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'afp_items WHERE item_category="'.$cat.'" ORDER BY item_id ASC');
}
$output='';
$k = 1;
foreach ($items as $item ){
$output.='<div class="afp-single-item">
<img alt="" class="img-link-initial" src="' . $item->item_thumbnail . '">
<div class="item-overlay" style="display: none;">
<img src="' . $item->item_thumbnail . '" width="101%">
<div class="wishlist-details">';
if($item->item_title != null) { $output.='<h2>' . $item->item_title . '</h2>'; }
$output.='
<span>Share This</span>
</div>
';
if($item->item_link != null) { $output.='<a target="_blank" class="buynow" href="' . $item->item_link . '">Buy Now</a>
'; }
$output.='
</div>
</div>';
$k++;
}
$output.='</div><div class="afp-clear"></div>';
echo $output;
Template code:
<?php
/**
* Template Name: Shop Page Template
*
*/
get_header(); ?>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=54330784694";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
<link rel='stylesheet' type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/isotop.css" />
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
<script src="<?php echo get_template_directory_uri(); ?>/js/jquery.isotope.js" type="text/javascript"></script>
<div id="show_wrap">
<div class="section-header" >
<h2>SHOP</h2>
</div>
<?php
global $wpdb;
//Get The Plugin Options
$afpOptions = get_option('afpOptions');
//SQL Queries
switch( $afpOptions['sort_items'] ){
case 'title':
$orderby = 'item_title ASC';
break;
case 'date':
$orderby = 'item_date DESC';
break;
case 'client':
$orderby = 'item_title ASC';
break;
case 'id':
$orderby = 'item_id ASC';
break;
}
$items = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'afp_items ORDER BY ' . $orderby);
if( $afpOptions['sort_cat'] == 'on' ){
$orderby = ' ORDER BY cat_name';
} else {
$orderby = '';
}
$cats = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'afp_categories' . $orderby);
?>
<div class="clear"></div>
<div class="portfolioFilter">
<?php
//AFP Main Container
echo 'All';
foreach ( $cats as $cat ){
echo '' . $cat->cat_name . '';
}
?>
</div>
<div class="portfolioContainer" style="padding-bottom:250px;">
<?php foreach ($items as $item ){ ?>
<div class="<?php echo ereg_replace("[^A-Za-z0-9]", "", $item->item_category); ?>">
<img alt="" class="img-link-initial" src="<?php echo $item->item_thumbnail; ?>">
<div class="item-overlay" style="display: none;">
<img src="<?php echo $item->item_thumbnail; ?>" width="101%">
<div class="wishlist-details">
<?php if($item->item_title != null) {?>
<h2><?php echo $item->item_title; ?></h2>
<?php } ?>
<p class="share_this">Share This</p>
<div class="shop_bottom_border_0ld"> </div>
<p class="social_share_box">
<div class="share_icon_only fleft"><div class="fb-share-button" data-href="<?php echo $item->item_link; ?>" data-type="button"></div></div>
<div class="share_icon_only fleft"><a target="_blank" href="https://twitter.com/share" class="twitter-share-button" data-url="<?php echo $item->item_link; ?>" data-count="none">Tweet</a></div>
<div class="share_icon_only fleft" style="width:40px;">
<a target="_blank" href="http://www.pinterest.com/pin/create/button/?url='<?php echo $item->item_link;?>&media=<?php echo $item->item_thumbnail; ?>&description=<?php echo $item->item_title; ?>"
data-pin-do="buttonPin"
data-pin-config="above">
<img src="//assets.pinterest.com/images/pidgets/pin_it_button.png" />
</a>
</div>
<div class="clear"></div>
</p><br />
<?php if($item->item_link != null) { ?>
<p><a target="_blank" class="buynow" href="<?php echo $item->item_link; ?>">Buy Now</a></p>
<?php } ?>
</div>
</div>
</div>
<?php } ?>
</div>
<div class="afp-clear clear20"></div>
</div>
<script type="text/javascript">
$(window).load(function(){
var $container = $('.portfolioContainer');
$container.isotope({
filter: '*',
animationOptions: {
duration: 750,
easing: 'linear',
queue: false
}
});
$('.portfolioFilter a').click(function(){
$('.portfolioFilter .current').removeClass('current');
$(this).addClass('current');
var selector = $(this).attr('data-filter');
$container.isotope({
filter: selector,
animationOptions: {
duration: 750,
easing: 'linear',
queue: false
}
});
return false;
});
});
</script>
<?php get_footer(); ?>
And the CSS
.buynow {
background-color: #F5D2D5;
color: #FFFFFF;
display: block;
float: left;
font-size: 12px;
font-weight: 400;
height: 42px;
letter-spacing: 0.3em;
line-height: 42px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
width: 230px;
}
.shop_bottom_border{
border-bottom:1px solid #CCC;
margin-bottom:5px;
}

Wordpress sidebar goes wrong way in bootstrap

Basically, i split up the page in 2 columns, and tried inserting sidebar code into the right one (span4). But for some reason, it keeps showing under span8
page code
<div class="row pull-right"><div class="span12" id="hdimg"></div></div>
<div class="row pull-right" id="pgg">
<div class="span8" id="pagecn">
<?php the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<div class="ttl">
<?php if ( is_singular() ) {echo '<h1 class="entry-title">';} else {echo '<h2 class="entry-title">';} ?><a title="<?php printf( __('Read %s', 'blankslate'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a><?php if ( is_singular() ) {echo '</h1>';} else {echo '</h2>';} ?>
</div>
<div id="cn">
<?php the_content(); ?>
</div>
</div>
</div>
</div>
<div class="span4">
<?php if ( is_active_sidebar('primary-widget-area') ) : ?>
<div id="primary" class="widget-area">
<ul class="sid">
<?php dynamic_sidebar('primary-widget-area'); ?>
</ul>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php get_footer(); ?>
css for it
#hdimg {
width: 948px;
height:185px;
background-image: url(images/banner.jpg);
}
#pgg {
width:948px;
margin-top:4px;
background-color: white;
padding-top: 10px;
padding-bottom: 20px;
}
#cn {margin-top: 15px;}
link to see live
http://soloveich.com/project3/
#pgg {
width:948px;
margin-top:4px;
background-color: white;
padding-top: 10px;
padding-bottom: 20px;
}
Remove width
#pgg {
margin-top:4px;
background-color: white;
padding-top: 10px;
padding-bottom: 20px;
}
I see what you tried to do but you used it incorrectly - fix background in a different way
<div class="" id="hdimg"></div>
This is for your header - remove grid class
change #hdimg width to
hdimg { width: 960px !important; }

Resources