• xtjan

    (@xtjan)


    I’m using wp-multilingual and have a website in two languages (estonian and english) (http://www.puhajarvetriatlon.ee). The posts are displayed on page “News”. I wanted to bring post titles also onto the front page and I’m using the following code to do that:

    <?php
    	global $post;
    	$myposts = get_posts('numberposts=6&order=DESC&orderby=date');
    	foreach($myposts as $post) :
    	?>
    	<li class="valge_pealkiri"><a href="<?php the_permalink(); ?>"><span style='font-size: 12px'><?php the_title(); ?></span></a> (<?php the_time('d.m.Y') ?>)</li>
    	<?php endforeach; ?>

    The problem with this code is that the post titles are only in Estonian (even when English language is selected and all other text is in English). When I click on the title though the link takes me to the same post in english.

    How can I get the titles on the front page in the language that is selected?

Viewing 4 replies - 1 through 4 (of 4 total)
  • can you mail me ? via plugin “request help”.

    can you mail me a test ftp connection to this site i will try to find problem and solve it

    othersphere

    (@othersphere)

    I have the same problem.

    It’s interesting that it started only when I changed my webhosting provider (it’s was OK before), so without any particular reason – I use the same version of WP, WP-Multilingual and everything. It’s mysterious! 😀

    This is what I use to show a link to a page (# is the number of a page):

    <?php
    	$args = array(
    	'post_type' => 'page',
    	'include' => #,
    	);
    		$pages = get_posts($args);
    		foreach($pages as $page) {
    		$out .=  '<a href="'.get_permalink($page->ID).'" >'.wptexturize($page->post_title).'</a>'; }
    	echo $out;
    	unset($out);
    	?>

    // Update: There’s another interesting thing: I’ve just found out that the titles stopped to change even on my Localhost where I haven’t made any changes. I’ve deleted all cookies but it hasn’t helped.

    othersphere

    (@othersphere)

    // Update 2:

    There has to be a problem in my theme – when I use different theme, the titles start to change again… I suppose it has something to do with the encoding of my theme because I made some changes in in :/

    Hmm, any ideas?

    // Update 3 + temporal solution:

    The problem is caused by the code I use in my template (shown above), though I don’t know why. As a temporal solution, this works for me:

    <?php wp_list_pages('include=#;title_li='); ?>

    Only it’s not terribly web-standard-friendly…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP-multilingual and titles on index page’ is closed to new replies.