how to specify language in script
-
hello,
on the homepage near the bottom shows latest posts, but i want the script recognise the language the visitor is using in order to show the correct title and buttontext.
now i typed all 3 languages on 1 row as u can seethe script behind this is:
<?php // WP_Query arguments $args = array ( 'post_type' => array( 'post' ), 'posts_per_page' => '1', ); // The Query $query = new WP_Query( $args ); // The Loop if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); ?> <div class="main-content-inner col-md-7"> <div class="home-block animate"> <hr class="b1"> <h2><?php echo pll__('Nieuws/News/Nouvelles'); ?></h2> <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4> <p><?php the_excerpt(); ?></p> <a href="<?php if( get_option( 'show_on_front' ) == 'page' ) echo get_permalink( get_option('page_for_posts' ) ); else echo bloginfo('url');?>" class="btn"><?php echo pll__('Meer Nieuws/More News/Encore des Nouvelles'); ?></a> </div> </div> <?php } } else { // no posts found } // Restore original Post Data wp_reset_postdata(); ?>
The page I need help with: [log in to see the link]
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘how to specify language in script’ is closed to new replies.