How do I horizontally align images in WordPress once turned into a PHP loop? - php

I want to unpack the question so that it is clear and you will see the code below. I turned my HTML Bootstrap page into a WordPress dynamic site. The images are no longer under the img tag. So if you look below, I am not sure if I need to be tweaking the col-xl-2 class or creating a has_post_thumbnail selector in CSS. I need for my images to go from vertically aligned to horizontally aligned. If you look at the The col-centered keeps it centered, but I need it to be horizontally aligned. I have tried following the guidance in the WordPress Codex regarding styling the_post_thumbnail and it has not helped.
This is my index.php file:
<?php
// Advanced Custom Fields
// this is a bunch of variables with our fields to echo out in PHP
$images_feature_title = get_field('images_feature_title');
$images_feature_body = get_field('images_feature_body');
$indianapolis_feature_title = get_field('indianapolis_feature_title');
$indianapolis_feature_body = get_field('indianapolis_feature_body');
$social_media_image = get_field('social_media_image');
$social_media_title = get_field('social_media_title');
$social_media_feature_body = get_field('social_media_feature_body');
?>
<?php get_header(); ?>
<!-- Carousel
================================================== -->
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<?php
$notun = new WP_Query(array(
'post_type' => 'bcarousel'
));
$indicator = -1;
while($notun->have_posts()) : $notun->the_post(); $indicator++ ?>
<li data-target="#myCarousel" data-slide-to="<?php echo $indicator; ?>"<?php if($indicator == 0) : ?> class="active" <?php endif; ?>></li>
<?php endwhile; ?>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<?php
$carousel = new WP_Query(array(
'post_type' => 'bcarousel',
));
$korim = 0;
while($carousel ->have_posts()) : $carousel ->the_post(); $korim ++ ?>
<?php if($korim == 1) : ?>
<div class="item active">
<?php else : ?>
<div class="item">
<?php endif; ?>
<div class="carousel-image">
<?php the_post_thumbnail(); ?>
<div class="carousel-caption">
<h1><?php the_title(); ?></h1>
<h2><?php the_content(); ?></h2>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
<!-- Left and right Carousel Arrows -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div><!-- /.carousel -->
<!-- Images Feature Section
================================================== -->
<!-- Wrap the rest of the page in another container to center all the content. -->
<!-- <div class="container marketing"> -->
<!-- Three columns of text below the carousel -->
<section class="row content-region-1 pt40 pb40">
<div class="container">
<?php $loop = new WP_Query(array('post_type' => 'images_feature','orderby' => 'post_id', 'order' => 'ASC')); ?>
<?php while($loop->have_posts()) : $loop->the_post(); ?>
<div class="col-xl-2 col-centered">
<?php
if (has_post_thumbnail()) {
the_post_thumbnail();
}
?>
<p><?php the_title(); ?> »</p>
<?php endwhile; ?>
</div><!-- /.col-lg-2 -->
</div>
</section><!-- /.row -->
<!-- Indianapolis Feature Section
================================================== -->
<section class="row" id="indy-glass">
<div class="container">
<div class="col-md-12">
<h2><?php echo $indianapolis_feature_title; ?></h2>
<hr />
<p class="lead"><?php echo $indianapolis_feature_body; ?></p>
</div>
<div class="col-md-12 text-center">
<p><a class="btn btn-danger" href="#" role="button">Learn More »</a></p>
</div>
</div>
</section>
<section class="row content-region-2 pt40 pb40" id="customer-testimonial">
<div class="container">
<div class="col-md-12">
<h1>What Our Customers Are Saying...</h1>
<p class="lead">We love Mirror Concepts! The team is professional and courteous and the new weightroom
mirrors look awesome!</p>
<cite>~ Jeff and Cindy Kivett</cite>
<p>Read More »</p>
</div>
</div>
</section>
<!-- Social Media Section
================================================== -->
<section class="row content-region-3 pt40 pb40" id="indy-glass">
<div class="container">
<div class="col-md-12 facebook-page">
<!-- If user uploaded an image -->
<?php if(!empty($social_media_image)) : ?>
<img src="<?php echo $social_media_image['url']; ?>" alt="<?php echo $social_media_image['alt']; ?>">
<?php endif; ?>
</div>
<h2><?php echo $social_media_title; ?></h2>
<hr />
<?php $loop = new WP_Query(array('post_type' => 'social_media_feature','orderby' => 'post_id', 'order' => 'ASC')); ?>
<?php while($loop->have_posts()) : $loop->the_post(); ?>
<div class="col-lg-2 col-centered">
<?php
if (has_post_thumbnail()) {
the_post_thumbnail();
}
?>
<?php endwhile; ?>
</div><!-- /.col-lg-2 -->
<p>See more on Facebook »</p>
</div>
</section>
<?php get_footer(); ?>
In the style.css file you will see some selectors commented out because after turning this into WordPress dynamic they seem to be ineffectual.
Style.css file:
/*
Theme Name: Mirror and Glass Theme
Author: Daniel Cortes
Author URI: http://dancortes.com
Description: Theme developed for MediaFuel
Version: 1.0
*/
/* GLOBAL STYLES
-------------------------------------------------- */
/* Padding below the footer and lighter body text */
body {
background: url('/wp-content/themes/mirror_glass/assets/img/tile.jpg') top left repeat;
}
h1,h2,h3,h4,h5,h6 {
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-weight: bold;
font-family: "Comic Sans MS", cursive, sans-serif;
text-align: center;
}
a {
color: #000000;
}
a#gallery {
color: white;
font-size: 24px;
}
/*Non-Bootstrap CSS*/
.content-region-1, .content-region-2, .content-region-3 {
/*text-align: center;*/
/*float: right;*/
}
#customer-testimonial {
background: #3e4249;
color: white;
}
#showroom {
text-align: center;
}
.btn-danger {
padding: 10px 20px;
margin-bottom: 10px;
font-size: 20px;
border-radius: 10px;
}
.btn-default {
border: none;
background-color: transparent;
font-size: 24px;
}
/*.col-centered {
display: inline-block;
float: none;
}*/
.container {
max-width: 1020px;
}
.navbar-default {
background-color: white;
margin-bottom: 0;
}
.header {
padding-bottom: 20px;
border-bottom: 1px solid #e5e5e5;
}
.header h3 {
margin-top: 40px;
margin-bottom: 10px;
line-height: 40px;
}
.carousel-image {
margin: 0 auto;
}
p {
margin-top: 4px;
}
a.link {
font-size: 20px;
}
a:hover {
text-decoration: none;
}
a.btn-default:hover {
text-decoration: none;
}
.fa {
font-size: 98px;
margin-top: 10px;
margin-bottom: -10px;
opacity: 0.1;
}
.facebook-page {
position: relative;
line-height: -0.8;
}
/*.col-xl-2 {
margin: auto;
text-align: center;
width: 100%;
display: block;
}*/
#indy-glass {
background: white;
}
.footer {
padding-top: 19px;
text-align: center;
color: #777;
border-top: 1px solid #e5e5e5;
}
.content-region-4 {
background: #000000;
color: #ffffff;
}
.side-widget {
margin-bottom: 40px;
}
.side-widget h3 {
border-left: 5px;
padding-left: 10px;
margin-bottom: 15px;
}
/*==== MEDIA QUERIES ====*/
#media screen and (max-width: 991px) {
.img-rounded {
margin: 12px;
}
}

Related

problem showing repeated whole page when trying to display data from database

I'm trying to display the data from the database, but whenever I connect it the whole page gets repeated - from the head title to a row and then it shows the head title again as if I had split the page, and another row from the database.
I want to show the data like the products page next to each other but it only shows one and then repeats the whole page.
This is my code that I tried - the page gets repeated from the main-container and shows one row, then repeats the main container again.
<?php
require_once 'opp_data.php';
$sql ="SELECT * FROM college_opp";
$allopp =$conn->query($sql);
?>
//i dont know if i have to show the whole code but this is only the code part where everything gets repeated
<?php
while ($row = mysqli_fetch_assoc($allopp)) {
?>
<div class="main-container">
<h2>تصفح الفرص التطوعية </h2>
<div class="post-collect">
<div class="post-main-container">
<div class="all sports">
<div class="post-img">
<img src="imgs/<?php echo $row["images"]; ?>">
<span class="category-name" data-name="sporty">كلية علوم الرياضة </span>
</div>
<div class="post-content">
<div class="post-content-top">
<span>
<i class="fa-solid fa-users-line"></i><?php echo $row["volunteer_num"]; ?>
</span>
<span><i class="fa-regular fa-calendar-days"></i><?php echo $row["Date"]; ?></span>
</div>
<h2>"<?php echo $row["Title"]; ?>"</h2>
<p>"<?php echo $row["Description"]; ?>"</p>
</div>
<div class="button-btn">
التفاصيل والتسجيل
</div>
</div>
</div>
</div>
</div>
<?php
}
?>
</body>
for the style.css\\
.main-container{
width: 90vw;
margin: 0 auto;
padding: 40px 0;
}
.main-container h2{
text-align: center;
padding: 90px 0;
font-size: 32px;
color: #fff;
}
.main-container p{
font-weight: 300;
padding: 10px 0;
opacity: 0.7;
text-align: center;
}
.post-main-container{
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 60px;
}
.post-main-container div{
box-shadow: 0px 8px 27px -12px rgba(0, 0, 0, 0.64);
}
.post-img{
position: relative;
width: 2vw;
height: 19vw;
}
.post-img img{
position: absolute;
left: 20px;
width: 17vw;
height: 19vw;
}
.post-content{
padding: 25px;
}
.post-content-top{
background: #2b1055;
color: #fff;
opacity: 0,9;
padding: 5px 0 5px 15px;
}
.post-content-top span{
padding-right: 20px;
}
.post-content h2{
font-size: 22px;
padding: 12px 0;
font-weight: 400;
}
.post-content p{
opacity: 0.7;
font-size: 15px;
line-height: 1.8;
color: ghostwhite;
}
.button-btn a {
padding: 8px 15px;
display: block;
font-family:'Almarai', sans-serif ;
font-size: 15px;
cursor: pointer;
background: transparent;
border-radius: 20px;
width: 50%;
border: 2px solid #fff;
color: #fff;
margin: 5px auto;
padding: 0.4rem;
text-decoration: none;
font-weight: 600;
transition: all 0.2s ease-in-out;
}
.button-btn a:hover{
background:#2b1055;
}
Because your entire page is in the while loop it will duplicate the whole page multiple times. I don't know if this is exactly what you want but I suggest you doing it something like this:
<?php
require_once 'opp_data.php';
$sql ="SELECT * FROM college_opp";
$allopp =$conn->query($sql);
?>
<div class="main-container">
<h2>تصفح الفرص التطوعية </h2>
<div class="post-collect">
<?php while ($row = mysqli_fetch_assoc($allopp)) { ?>
<div class="post-main-container">
<div class="all sports">
<div class="post-img">
<img src="imgs/<?php echo $row[" images "]; ?>">
<span class="category-name" data-name="sporty">كلية علوم الرياضة </span>
</div>
<div class="post-content">
<div class="post-content-top">
<span>
<i class="fa-solid fa-users-line"></i><?php echo $row["volunteer_num"]; ?>
</span>
<span><i class="fa-regular fa-calendar-days"></i><?php echo $row["Date"]; ?></span>
</div>
<h2>"
<?php echo $row["Title"]; ?>"</h2>
<p>"
<?php echo $row["Description"]; ?>"</p>
</div>
<div class="button-btn">
التفاصيل والتسجيل
</div>
</div>
</div>
<?php } ?>
</div>
</div>
This will only loop the post-main-container.
This is the code you are looking for
<div class="main-container">
<h2>تصفح الفرص التطوعية </h2>
<div class="post-collect">
<div class="post-main-container">
<?php
while ($row = mysqli_fetch_assoc($allopp)) {
?>
<div class="all sports">
<div class="post-img">
<img src="imgs/<?php echo $row["images"]; ?>">
<span class="category-name" data-name="sporty">كلية علوم الرياضة </span>
</div>
<div class="post-content">
<div class="post-content-top">
<span>
<i class="fa-solid fa-users-line"></i><?php echo $row["volunteer_num"]; ?>
</span>
<span>
<i class="fa-regular fa-calendar-days"></i><?php echo $row["Date"]; ?>
</span>
</div>
<h2>"<?php echo $row["Title"]; ?>"</h2>
<p>"<?php echo $row["Description"]; ?>"</p>
</div>
<div class="button-btn">
التفاصيل والتسجيل
</div>
</div>
<?php
}
?>
</div>
</div>
</div>

a href(for button) not working on caraousel

href is not able to clickable on carousel due to jQuery
Carousel is using jQuery for automated sliding and when I'm placing an element with a href tag it's not working, also as the project is using multiple JavaScript files for fast uploading. I'm not able to identify how to make href clickable on carousel.
How can I overwrite existing jQuery to make only that particular href clickable?
<li class="ds cover-image animated scaleAppear">
<img src="<?php echo $Domain;?>img/slide2.jpg" alt="img">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="row text-center" style="text-align:center;">
<div id="arrow-left" class="arrow">
<div class="col-sm-6 ">
<h6 id="firstLineh6"><span style="font-size:50px;">■</span>Farming-as-a-Service</h6>
<h1 id="firstLineh1">Advance,Affordable,<br>Accessible</h1>
<div class="vertical">
<p id="contP">
We are making advanced farm mechanization services affordable to farmers through the
Pay and Use Model
</p>
</div>
<a id="carbtn1" href="https://google.com">Traxi Customer</a>
<a id="carbtn2" href="https://google.com">Traxi Partner</a>
<div class="col-sm-6 fade-in text-center" style="text-align:right;"></div>
</div>
<div class="intro_layers_wrapper">
<div class="intro_layers">
<!-- <div class="intro_layer">
<p class="intro_before_featured_word pTextSize">Looking For Mechanized Crop Cultivation? </p>
<p class="text-capitalize intro_featured_word pTextSize"> We are the "Solution" </p>
<br>
Tell Us Your Farming Need
</div> -->
</div>
</div>
</div>
</div>
</div>
</li>
Hey there as I got that your all links working with above code.
https://imgur.com/a/DeZd2K9
But if you still facing issue with your Code you can try given below code for slider-
.bs-fullscreen {
height: 100%;
}
.bs-fullscreen .carousel,
.bs-fullscreen .item,
.bs-fullscreen .active {
height: 100%;
}
.bs-fullscreen .carousel-inner {
height: 100%;
}
.carousel-bg .carousel-inner .item {
background-color: darkslategrey;
background-size: cover;
background-position: center;
min-height: 664px;
}
.banner-text {
position: absolute !important;
top: 215px;
left: 12%;
background: rgba(0, 0, 0, 0.5);
padding: 47px 80px;
}
.banner-text p {
font-size: 16px;
font-family: 'Roboto';
color: #fff;
font-weight: 600;
}
.banner-text h2 {
font-size: 42px;
font-family: 'Poppins';
font-weight: 600;
color: #fff;
line-height: 44px;
}
.banner-text a {
font-size: 16px;
color: #000;
font-weight: 800;
background: #fff;
padding: 10px 20px;
font-family: 'Roboto';
}
.banner-text span {
font-size: 48px !important;
}
#media only screen and (max-width:600px) {
.banner-text span {
font-size: 34px !important;
}
}
#media only screen and (max-width:400px) {
.banner-text {
position: center;
}
}
<!doctype html>
<html>
<body>
<div class="bs-fullscreen">
<div id="carousel-example" class="carousel slide carousel-bg" data-ride="carousel" data-interval="3000">
<!-- Bottom dots {indicators} -->
<div class="carousel-inner" role="listbox">
<div class="item active"
style="background-image: url(https://www.ashleyandalvis.com/wp-content/uploads/4-3-1.jpg);">
<div class="banner-text">
<p>Eco Friendly | Feathery Light Perfect Fit</p>
<h2>50 WASH <br><span>UNDERWEARS</span></h2>
Shop Collection
</div>
</div>
<div class="item mob-banner"
style="background-image: url(https://www.ashleyandalvis.com/wp-content/uploads/Desktop-View-Home-Page-banner-1280x720px-1.jpg);">
<div class="banner-text">
<p>Memory Stretch | Skinny Soft Modal</p>
<h2>CONFIDENCE <br><span>INSIDE</span></h2>
Shop Collection
</div>
</div>
<div class="item mob-banner1"
style="background-image: url(https://www.ashleyandalvis.com/wp-content/uploads/Confidence-INSIDE-MOBILE-SLIDER-1280-%C3%97-720px.png);">
<div class="banner-text">
<p>Memory Stretch | Skinny Soft Modal</p>
<h2>CONFIDENCE <br><span>INSIDE</span></h2>
Shop Collection
</div>
</div>
</div>
<a class="left carousel-control" href="#carousel-example" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only"></span>
</a>
<a class="right carousel-control" href="#carousel-example" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only"></span>
</a>
</div>
</div>
</body>
</html>
Hope you like the answer.

Change class of the last instance of an item within a loop with WordPress/ACF

I want to insert an arrow image between each div with the class product-icon in a WordPress loop using the ::after CSS pseudo-element. Right now the arrow shows up after every product-icon div the loop populates, but I want it to be hidden after the last one (and the number of divs displayed changes depending which page you're on). I'm guessing I'll need to change the class of the last div in the loop, but I'm not sure how to do that. Here's an HTML version so you can see what it should look like:
<section id="case-study-product-overview" class="horizontal">
<div class="max-container">
<div id="product-map-container">
<div>
<div class="product-icon"><img src="https://cdn4.iconfinder.com/data/icons/basic-for-user-interface-vol-1/24/add-_plus-_create_-square-_Add_Button-512.png"><p class="icon-subtitle">Icon 1</p></div>
<div class="product-card">
<h3 class="product-overview-title green-text">Title 1</h3>
<img class="product-image" src="https://icons.iconarchive.com/icons/paomedia/small-n-flat/1024/sign-check-icon.png">
<p class="blurb">Lorem ipsum dummy paragraph text.</p>
</div>
</div>
<div>
<div class="product-icon"><img src="https://cdn4.iconfinder.com/data/icons/basic-for-user-interface-vol-1/24/add-_plus-_create_-square-_Add_Button-512.png"><p class="icon-subtitle">Icon 2</p></div>
<div class="product-card">
<h3 class="product-overview-title green-text">Title 2</h3>
<img class="product-image" src="https://icons.iconarchive.com/icons/paomedia/small-n-flat/1024/sign-check-icon.png">
<p class="blurb">Lorem ipsum dummy paragraph text.</p>
</div>
</div>
<div>
<div class="product-icon"><img src="https://cdn4.iconfinder.com/data/icons/basic-for-user-interface-vol-1/24/add-_plus-_create_-square-_Add_Button-512.png"><p class="icon-subtitle">Icon 3</p></div>
<div class="product-card">
<h3 class="product-overview-title green-text">Title 3</h3>
<img class="product-image" src="https://icons.iconarchive.com/icons/paomedia/small-n-flat/1024/sign-check-icon.png">
<p class="blurb">Lorem ipsum dummy paragraph text.</p>
</div>
</div>
</div>
</div>
</section>
here's the PHP I am ACTUALLY working with:
<section id="case-study-product-overview" class="horizontal">
<div class="max-container">
<h2 class="cs-heading eaton-blue-text">Product Overview</h2>
<div id="product-map-container">
<?php if ( have_rows('product_overview_map') ): ?>
<?php while( have_rows('product_overview_map') ): the_row(); ?>
<div>
<!-- ** This line is what the arrow should come after, except the last one** -->
<div class="product-icon"><img src="<?php echo get_sub_field('product_overview_icon'); ?>"/>
</div>
<!-- -->
<p class="icon-subtitle"><?php echo get_sub_field('product_overview_icon_label'); ?></p>
<div class="product-card">
<h3 class="product-overview-title eaton-blue-text"><?php echo get_sub_field('product_title'); ?></h3>
<img class="product-image" src="<?php echo get_sub_field('product_image'); ?>" />
<p class="blurb"><?php echo get_sub_field('product_description'); ?></p>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
</section>
and the CSS:
#case-study-product-overview .ecosystem-diagram {
min-height:650px;
margin-top:3%;
}
#case-study-product-overview .ecosystem-item {
position:absolute;
width:250px;
align-items:center;
margin-left:-125px;
margin-top:-100px;
}
#case-study-product-overview .image {
width:300px;
height:300px;
display:flex;
align-items:flex-end;
}
#case-study-product-overview .image img {
max-height:250px;
max-width:245px;
}
.product-icon::after {
content: url(http://wordpress-dev.tcc.etn.com/wordpress/iot/wp-content/uploads/sites/11/2019/07/arrows.png);
position: absolute;
top: 25px;
margin:0 32px;
}
.last-product-icon::after {
content:'';
}
.product-icon > img {
width: 50px;
height: 50px;
}
#product-map-container {
display: flex;
margin: 50px 0;
justify-content: center;
position: relative;
}
#product-map-container > div {
margin: 10px;
text-align: center;
}
.product-card {
box-shadow: 1px 1px 6px 1px #999;
max-width: 240px;
min-height: 475px;
padding: 10px;
}
.product-image {
width: 200px;
margin:auto;
}
Any help would be greatly appreciated. Thanks!

How to align title and current date in the same line in wordpress/php?

I have a html/php code as shown below:
Code A:
<header class="entry-header container">
<?php the_title('<h1 class="entry-title" id="page-entry-title">', '</h1>'); ?>
</header><!-- .entry-header -->
The CSS for the above html/php code is:
.entry-header {
font-size: 18px;
font-size: 1.8rem;
background: #3c3f47;
display: block;
}
.entry-title {
font-size: 1.8rem;
color: #FFF;
margin: 0;
padding: 1.2rem 0;
}
Code B:
This is the function I will use to get the current date:
echo date('y-m-d')
Problem Statement:
I am wondering if there is any way to integrate Code A and Code B so that title and date are displayed in the same line.
Your css :
entry-header {
font-size: 18px;
font-size: 1.8rem;
background: #3c3f47;
}
entry-title {
font-size: 1.8rem;
color: #FFF;
margin: 0;
padding: 1.2rem 0;
display: inline;
}
<span class="entry-header">header</span>
<span class="entry-title">date here</span>
<--Date in your header-->
<header class="entry-header container">
<span class="entry-title">date here </span>
<span class="entry-title"><?php the_title('<h1>', '</h1>'); ?></span>
</header><!-- .entry-header -->
see here for example : https://www.w3schools.com/css/tryit.asp?filename=trycss_inline-block_span1
Simply just add the echo next to the_title() function and make the h1 tag display inline block so it doesn't take up the entire width of the header. (Added tags around date for semantics but not necessary).
PHP:
<header class="entry-header container">
<?php the_title('<h1 class="entry-title" id="page-entry-title">', '</h1>'); echo '<span class="entry-date">' . date('y-m-d') . '</span>'; ?>
</header><!-- .entry-header -->
CSS:
.entry-header {
font-size: 18px;
font-size: 1.8rem;
background: #3c3f47;
display: block;
}
.entry-title {
font-size: 1.8rem;
color: #FFF;
margin: 0;
padding: 1.2rem 0;
display: inline-block;
}
wrap in span's or if you want to use h1 tags set display to inline-block
<header class="entry-header container">
<span>Senate Portal</span>
<span>July 6 ,1966</span>
</header><!-- .entry-header -->

Issues with Inline-Block making Images Smaller?

I'm trying to get these three images on this page to load in one after each other. When I set it to "Inline-Block" in css, it works, but the images get really small.
https://www.palmersdeliandmarket.com/holiday/
Here's my CSS:
.categories ul li a.current { font-weight: bold; }
#shopp .category { position: relative; display: inline-block;}
#shopp .views { display: inline; position: absolute; right: 0; top: 0; }
#shopp .views button { border: 1px solid transparent; background: none; cursor: pointer; padding: 2px; margin-bottom: -3px; }
#shopp .views button.hover { background-color: #ebebeb; border: 1px solid #777; }
#shopp .views li { display: inline; }
#shopp .orderby { float: right; }
and my HTML:
<?php if(shopp('category','hasproducts','load=coverimages')): ?>
<div class="alignright"><?php shopp('category','pagination','show=10'); ?></div>
<ul class="products">
<li class="row"><ul>
<?php while(shopp('category','products')): ?>
<?php if(shopp('category','row')): ?></ul></li><li class="row"><ul><?php endif; ?>
<li class="product">
<div class="frame">
<?php shopp('product','coverimage','setting=gallery-previews'); ?>
<div class="details">
<h4 class="name"><?php shopp('product','name'); ?></h4>
<p class="price"><?php shopp('product','saleprice','starting=from'); ?> </p>
<?php if (shopp('product','has-savings')): ?>
<p class="savings">Save <?php shopp('product','savings','show=percent'); ?></p>
<?php endif; ?>
<div class="listview">
<p><?php shopp('product','summary'); ?></p>
<form action="<?php shopp('cart','url'); ?>" method="post" class="shopp product">
<?php shopp('product','addtocart'); ?>
</form>
</div>
</div>
</div>
</li>
<?php endwhile; ?>
</ul></li>
</ul>
<div class="alignright"><?php shopp('category','pagination','show=10'); ?></div>
</div>
<?php else: ?>
<?php if (!shopp('catalog','is-landing')): ?>
<?php shopp('catalog','breadcrumb'); ?>
<h3><?php shopp('category','name'); ?></h3>
<p>No products were found.</p>
<?php endif; ?>
<?php endif; ?>
Thanks, any help is appreciated.
display: inline-block + width: auto gives a width only large enough to fit the contents. Add width: 100%.

Categories