How to localize theme?
-
19-10-2022 - |
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>
Pas de solution correcte
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow