Need help with time and date

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stlastla
Forum Newbie
Posts: 1
Joined: Sat Oct 08, 2011 3:24 pm

Need help with time and date

Post by stlastla »

Hi,

I´m working with a code on a wordpress blog.

the code goes as follows:

Code: Select all

<?php get_header(); ?>
<div id="content">
	<?php if(get_option('freshlife_featured_content_enable') == 'on') { ?>
		<div id="featured-content">
			<div class="heading">
				<span class="heading-text"><?php _e('Hovedoppslag', 'themejunkie'); ?></span>
			</div> <!-- end .heading -->
			<ul>
				<?php
					$counter = 1;
					query_posts( array(
						'showposts' => get_option('freshlife_featured_post_num'),
						'tag' => get_option('freshlife_featured_post_tags')			
					) );	
					if( have_posts() ) : while( have_posts() ) : the_post();
				?>
					<li class="featured-<?php echo $counter; ?>"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_post_thumbnail('featured-thumb', array('class' => 'entry-thumb')); ?></a><span class="entry-date"><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')) . __(' siden', 'themejunkie'); ?></abbr></span><h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2></li>
				<?php $counter++; endwhile; endif; wp_reset_query(); ?>
			</ul>
		</div> <!-- end #featured-content -->
This is as you probably see a code for telling the time of when a wordpress post was published. I need to identify where the word "day" comes from within the code.
If you take a look at http://www.digio.no and look at the featured posts which a located at the top under the name "hovedoppslag" You will see the text "1 day siden" in the upper left corner of the picture. I want to translate that word into an other language or remove it.

Can somebody tell me how I do that?
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: Need help with time and date

Post by twinedev »

It is this bit of code that is in what you gave:

Code: Select all

<?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . __(' siden', 'themejunkie'); ?>
specifically the

Code: Select all

 __(' siden', 'themejunkie'); 
I'm not a big WP person, but check this page for how that function works:
http://codex.wordpress.org/Function_Reference/_2

-Greg
Post Reply