Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: change order

  1. #1
    Regular Coder
    Join Date
    Oct 2009
    Location
    GERMANY
    Posts
    140
    Thanks
    29
    Thanked 1 Time in 1 Post

    change order

    Hey guys,

    I am currently having this structure displayed on my posts:

    "Admin wrote Article blablal 35 minutes ago."

    I want the "ago" before "35 Minutes". This is the code:

    PHP Code:
    <abbr title="<?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?>"><?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . __(' ago''themes');
    How can I place the word "ago" before "35 minutes"?

  • #2
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    Quote Originally Posted by OGGordon View Post
    Hey guys,

    I am currently having this structure displayed on my posts:

    "Admin wrote Article blablal 35 minutes ago."

    I want the "ago" before "35 Minutes". This is the code:

    PHP Code:
    <abbr title="<?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?>"><?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . __(' ago''themes');
    How can I place the word "ago" before "35 minutes"?
    Why would you want to?
    Useful function to retrieve difference in times
    The best PHP resource
    A good PHP FAQ
    PLEASE remember to wrap your code in [PHP] tags.
    PHP Code:
    // Replace this
    if(isset($_POST['submitButton']))
    // With this
    if(!empty($_POST))
    // Then check for values/forms. Some IE versions don't send the submit button 
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Quote Originally Posted by OGGordon View Post
    PHP Code:
    <abbr title="<?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?>"><?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . __(' ago''themes');
    How can I place the word "ago" before "35 minutes"?
    Just switch the order:
    PHP Code:
    <?php echo __(' ago''themes') . human_time_diff(get_the_time('U'), current_time('timestamp'));

  • Users who have thanked Inigoesdr for this post:

    OGGordon (02-01-2012)

  • #4
    Regular Coder
    Join Date
    Oct 2009
    Location
    GERMANY
    Posts
    140
    Thanks
    29
    Thanked 1 Time in 1 Post
    thanks, I switched it the wrong way and it kept showing an error, but yours worked.

    I have a german website, grammatically it's correct to use the german word for "ago" before the timestamp .

  • #5
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    Quote Originally Posted by OGGordon View Post
    thanks, I switched it the wrong way and it kept showing an error, but yours worked.

    I have a german website, grammatically it's correct to use the german word for "ago" before the timestamp .
    Ah, interesting
    Useful function to retrieve difference in times
    The best PHP resource
    A good PHP FAQ
    PLEASE remember to wrap your code in [PHP] tags.
    PHP Code:
    // Replace this
    if(isset($_POST['submitButton']))
    // With this
    if(!empty($_POST))
    // Then check for values/forms. Some IE versions don't send the submit button 
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.


  •  

    Posting Permissions

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