WordPress.org

Ready to get started?Download WordPress

Forums

Add Space Between Date and Time (2 posts)

  1. okaprasumba
    Member
    Posted 1 year ago #

    my post date code is <div class="post-date"><?php the_time('j M Y H i'); ?></div> and it will show for exmple : 14 apr 2013 11.30. how to create space between the date (14 apr 2013) and time (11.30) so it can show like this : 14 apr 2013___11.30 ??
    i'm new in wordpress and i dont know anything about php so please somebody help me :(

  2. JonWicks25
    Member
    Posted 1 year ago #

    In your child theme you can do the following;

    Note if you are not using a child theme see here as you should not edit the core files of a theme

    You could put them in different divs and add styling to each div.

    Example:

    <div class="post-date"><?php the_time('j M Y'); ?></div><div class"post-time"><?php the_time('H i'); ?></div>

    Then all you need to do is change the css. so in your css if you added

    .post-time {
    margin-left: 40px
    }

    This would add a margin of 40px between the date and the time. Obviously that is depending on your current css style of .post-date

Topic Closed

This topic has been closed to new replies.

About this Topic