Question

I have a problem with my theme translation because it is not a string but span and I can't translate.

I use WPML String Translation Widget.

This is the source code in SinlePost.php

<?php
                $prev_post = get_previous_post();
                $next_post = get_next_post();

                if ( !empty( $prev_post ) ){ 
                ?>
                <div class="nav-previous">
                    <?php previous_post_link( '%link', '<i class="icon-chevron-left"></i><span class="sub-title">Previous article</span><br />%title' ); ?>
                </div>
                <?php } ?>

and how should I modify to translate words Previous Post into my native language.

Please help me, because I am a beginner in Wordpress? Thanks to all.

Was it helpful?

Solution

What happen if you use the function __( inside the function previous_post_link?

<?php previous_post_link( '%link', __('<i class="icon-chevron-left"></i><span class="sub-title">Previous article</span><br />%title') ); ?>

After you need to rescan your theme in your wp-admin and then go in String Tranlation page to see if it's there.

Maybe it's not the solution but try it and tell me what it gives you.

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