SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Apr 2012
    Location
    Gold Coast, Queensland, Australia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wordpres Blog - Split the output on the date

    I'm in the process of styling the date on my wordpress blog so that it looks like the attached image. This is what it looks like so far.

    I've been told that I need to find the function below and get it to split the output first, one for the day of the month, one for the month formatted as three letters and then output the day and the month separately in the div. The problem is, I have no idea what needs to be changed/added to the PHP to achieve this.

    Here's the PHP:

    PHP Code:
    <div class="post-date">
                            <?php if ( $elems['date'] ) { btp_entry_render_date(); } ?>
                                    </div>
    Here's the CSS:

    Code:
    .post-date {
        background-image:url("/wp-content/uploads/2012/04/post-data-bg.png") !important;
        background-repeat:no-repeat;
    }
    Any help would be appreciated, thanks.
    Attached Images Attached Images

  2. #2
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What you really need to do is look at the function

    btp_entry_render_date

    Im guessing this is what will format the output from a Database entry to the existing format.
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  3. #3
    SitePoint Member
    Join Date
    Apr 2012
    Location
    Gold Coast, Queensland, Australia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply! I don't quite understand what you mean. Do I need to change the following line of code and, if so, what do I need to change?

    <?php if ( $elems['date'] ) { btp_entry_render_date(); } ?>

    Sorry if I'm not making sense, this is not my strong area! Thanks

  4. #4
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    Can't you use the normal WP date and time tags? I don't know which theme you're using, but you should be able to format the date with the standard WordPress functions.

    If you create more than one post per day and want to display the dates of all, then I'd use the_time();, otherwise I'd use the_date.

    With these functions, you can split up the day, month, and year separately.
    Maleika E. A. | Rockatee | Twitter | Dribbble



  5. #5
    SitePoint Member
    Join Date
    Apr 2012
    Location
    Gold Coast, Queensland, Australia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great, thanks for the help guys, I tried your suggestion kohoutek and it worked nicely. Cheers!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •