WordPress.org

Support

Support » Plugins and Hacks » Add to cart buttons not aligning

Add to cart buttons not aligning

Viewing 9 replies - 1 through 9 (of 9 total)
  • @caidynmiller, i would say edit CSS will be a quick fix.

    Try add below code to your theme CSS file, hope this will solve your problem.

    ul.products li.product h3 {height: 100px; line-height: 100px}

    do i add this to my /style.css file? or woocommerce.css file

    That code doesnt align it properly

    you need to add that to wp-content/themes/superstore/style.css

    Confirmed this overide aligns the buttons but it effect everything (title, price and more) within that

      It does not work.

    @caidynmiller, did you get your site working? I can’t see anything on the page you listed.

    I’ve got the same problem over here and wasn’t able to fix it with css.

    So i’ve gotten into content-product.php (in woocommerce/templates)

    and did the following to output the product title:

    <h3><?php
                 if(strlen(get_the_title()) < 17) { echo "<br>"; echo get_the_title(); }
                 else echo get_the_title();
         ?></h3>

    So this solves it a little bit by just adding a new line if the title is to short and thus putting all the add to cart buttons on same line.

    I know it breaks when the page gets bigger or smaller. Do you have any suggestions on how to improve this?

    Maybe i don’t see a good way because this is my first encounter with php

    terrytsang’s solution works fine, tankh you. Change around the height to fit your theme if you think the height is too big or too small.

    bilalirfan

    @bilalirfan

    .woocommerce ul.products li.product h3, .woocommerce-page ul.products li.product h3 {
    padding: .5em 0;
    margin: 0;
    font-size: 1em!important;
    min-height: 44px;
    }

    This will get it perfect.

    I didn’t write this code though. Got it from support forum.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Add to cart buttons not aligning’ is closed to new replies.