WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Adding padding to this code? (7 posts)

  1. iuchewie
    Member
    Posted 5 years ago #

    Is there a way to add padding to this code or does it need to be done via CSS?

    <?php the_post(); userphoto_the_author_photo('', '', array(align => 'right', border =>'1')); rewind_posts(); ?>

    Thanks in advance.

    chewie

  2. peiqinglong
    Member
    Posted 5 years ago #

    Where exactly would you like the padding? You could always use the span style and do it inline.

  3. iuchewie
    Member
    Posted 5 years ago #

    The image that this is displaying is being shown on this page - http://talkflop.com/blog/?author=2

    I'd like to get some additional padding around the image so the words don't bump up right against the image.

    chewie

  4. peiqinglong
    Member
    Posted 5 years ago #

    See if this will work for you:

    <?php the_post(); userphoto_the_author_photo('', '', array(align => 'right', border =>'1', class =>'author-image')); rewind_posts(); ?>

    and add img .author-image {padding: 5px; } to your stylesheet.

    or try this:

    <?php the_post(); echo "<span style=\"padding:5px;\">"; userphoto_the_author_photo('', '', array(align => 'right', border =>'1')); echo "</span>"; rewind_posts(); ?>

  5. iuchewie
    Member
    Posted 5 years ago #

    unfortunately neither of those worked...

    the first option broke the author.php page and the second option had no effect.

    thanks for trying though!

  6. peiqinglong
    Member
    Posted 5 years ago #

    You could add this in your stylesheet:

    #content img {padding: 5px; }, but this will give any images in the content a padding of 5px...

  7. iuchewie
    Member
    Posted 5 years ago #

    finally figured this out...

    <?php the_post(); userphoto_the_author_photo('', '', array(vspace => '5', hspace => '5', align => 'right', border =>'1')); rewind_posts(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic