Display text at specific hour
-
Hi! I’m new to WordPress themes.
I’ve been creating one from scratch and I’ve run into a problem. In the comment loop I want to display the comment’s time preceded by “a la” or “a las” depending on the hour.
“a la” should only appear if it’s 1 am or 1 pm.
I wrote the following code:
<?php if(comment_time('g') == 2) { echo 'a la'; } else { echo 'a las'; } ?> <?php comment_time); ?>
But the code above does not work! It displays: “1a las 1:23 pm”.
Could you help me identify what’s wrong?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Display text at specific hour’ is closed to new replies.