WordPress.org

Support

Support » Plugins and Hacks » WooCommerce » [Resolved] 'Single Product' Page – Adding top margin (above product title/ header)

[Resolved] 'Single Product' Page – Adding top margin (above product title/ header)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Solved-

    I edited the following child theme file:

    …child-theme/woocommerce/single-product/title.php

    Before edit:

    if ( ! defined( ‘ABSPATH’ ) ) exit; // Exit if accessed directly

    ?><P>
    <font color=”white”><h2 itemprop=”name” class=”product_title entry-title”><?php the_title(); ?></h2></font>

    After edit:

    if ( ! defined( ‘ABSPATH’ ) ) exit; // Exit if accessed directly

    ?><P>
    <font color=”white”><h2 itemprop=”name” class=”product_title entry-title” style=”margin-top: 2em”><?php the_title(); ?></h2></font>

    Hopefully this helps future inquiries people may have relating to this subject.

    Cheers*

    EDIT:

    I’ve found an alternative way to customize the size, colour, and padding of the Woocommerce ‘Single Product’ page title:

    – Dashboard > Appearance > Editor > style.css
    – Add the following coding:

    .product_title {
    color: #ffffff !important;
    font-size: 18px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    }

    That’s it. Hope this helps others*

    EDIT:

    Ok, the coding I just posted works very well; however, while it customizes the product title, the padding applies to the title while leaving the product image in its original spot (now slightly above the product title).

    So here is the final edit:

    .product_title {
    color: #ffffff !important;
    font-size: 18px !important;
    }

    .single-product .product { padding-top: 10px !important; }

    This allows you to edit the color and font size of the single product title, while adding space/ padding to both the single product image AND the single product title. This makes it aesthetically more uniform and even.

    Cheers*

    Thx, CRMacDonald5 for your code.

    After spending hours looking for a solution like this – with many solutions not working at all. Your code worked perfectly and made it possible for me (with almost no knowledge of php) to tweek my homepage.

    So thx a lot !!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] 'Single Product' Page – Adding top margin (above product title/ header)’ is closed to new replies.
Skip to toolbar