Diffrenet functions,Same CSS, Different Outputs Position! A wordpress theme problem!

Hey all!
I don’t know why does it happen but it’s totally strange to me:
If i use Get_the_time(), The output (date) is correctly positioned, No problem, check this:

But if i use the_time(), then the output refuses to get into the right position:

I’m really confused and I have to use the_time() function in order to do some conversions,
What’s the Cause?
Any solutions?
Thank you all!

Hi drag0nfly, welcome to SitePoint! :slight_smile:

Hmm, it will be something to do with the html/css, not php, most likely. Is the PHP code placed inside the same HTML element both times?

Best post the HTML/CSS that is output in both cases so we can debug it. Otherwise it’s pointless guesswork.

Hey ralph,
here is the code:


if ($show_meta) {	
		$postheader .= '<span class="entry-meta"><span class="entry-comments">' . get_comments_number() . '</span>';
		$postheader .= 
		'<abbr class="published" title="">' .get_the_time( get_option('date_format') ).'</span>' . '</abbr></span>';
	}

and the CSS:

.posts-default .published { float: right; margin: 5px 5px 0; }

The problem happens when i change the get_the_time to the_time.

This might not be relevant, but you shouldn’t be able to just switch out those functions.

The “get_the_time” function, as far as I know, returns the time as a value that PHP can manipulate. The “the_time” function is supposed to actually echo the time onto the page.

From the Wordpress Codex.

Maybe this is part of the problem?

Hey mate,
Sounds interesting, but actually get_the_time() prints the date to the screen , no need to use Echo or similar functions :rolleyes:
what do you think ? what could be the cause?

I was more asking for the full html output and CSS that styles it, rather than the PHP. The final result on-screen will be down to the HTML/CSS, not the PHP.