Question

I am currently trying to localize my theme, and am still a little confused with when to use e, _ or print f.

For example what would be the correct way with this -

<p class="article-author"><?php _e( 'article written by', 'mytheme' ); ?><span><?php the_author_link(); ?></span></p>

or with this -

<p><?php _e( 'posted on', 'mytheme' ); ?> <span><?php the_time( 'F jS Y' ); ?></span> <?php _e( 'in', 'mytheme' ); ?> <span><?php the_category( ' & ' ); ?></span> <?php _e( 'with', 'mytheme' ); ?> <span><a href="#comments"><?php $commentscount = get_comments_number(); echo $commentscount; ?> <?php _e( 'Comments', 'mytheme' ); ?></a></span></p>

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top