WordPress.org

Ready to get started?Download WordPress

Forums

Post Width (2 posts)

  1. cms2043
    Member
    Posted 9 months ago #

    Hello,
    My site is demo.thepaisleybox.com.

    I am trying to reduce the width of the blog posts on my homepage. I found that if I change the below code from 16 to 66 the width is reduced perfectly. However, when I do this it also moves down the text on my product description pages (example description page here: http://demo.thepaisleybox.com/product/bridesmaid-box/ ).

    .entry-summary {padding: 16px;}

    Any way to increase the padding on the homepage blog posts without affecting the product description pages?

  2. Josh (WP Edit)
    Member
    Posted 9 months ago #

    Yep... but you will need to use a child theme with a custom functions.php file.

    Once you have your custom functions.php file.. we can begin to use "conditionals" in our code.

    So, something like this should work:

    function cms2043_adjust_homepage_padding() {
       if(is_home()) {
          ?>
          <style type="text/css">
          .entry-summary {padding: 66px;}
          </style>
          <?php
       }
    }
    add_action('wp_print_styles', 'cms2043_adjust_homepage_padding');

Reply

You must log in to post.

About this Topic