I assume those things are hard-coded into the theme you’re using like this:
<h2>Random Posts</h2>
To make the languages work, afaik, it’s:
<h2><?php _e(‘Random Posts’); ?></h2>
Thread Starter
spida2
(@spida2)
Yeah, wow, it works!
Thank you for your help!
EDIT:
Just this one’s a problem:
<?php
if (is_single()) {
$posts_widget_title = 'Recent Posts';
} else {
$posts_widget_title = 'Random Posts';
}
?>
How do I handle it best?
The same way really, just replace the text with your variable:
<h2><?php _e($posts_widget_title); ?></h2>
Thread Starter
spida2
(@spida2)
But I cannot put php into php, can I?
Or should it be like this:
<?php
if (is_single()) {
echo '<h2><?php _e($posts_widget_title); ?></h2>';
} else {
echo '<h2><?php _e($posts_widget_title); ?></h2>';
}
?>
But this would not make sense, since both times the same widget title will be given. Or am I on the wrong track?
Cheers,
Luka