A client website use 2 language for its news. Just for

A client website use 2 language for its news. Just for news, the rest of the contents will use English as its main language.

I need to make a page that list all the news from a certain categories. To make it as a list, there is a plugin that i can use to achieve this. My problem now, i need to create the list side by side where english on the left and the other language on the right. Its like a table, or list with paginated contents.

Example:
------------------------------------------------------------------------
|Date | English | Other language |
------------------------------------------------------------------------
|05/12/2013 | The title of the post (hyperlink) | Lorem ipsum post (hyperlink) |
------------------------------------------------------------------------

Example

I also posted to Wordpress.org forum here

  • PC
    • WPMU DEV Initiate

    Hey there,

    Thanks for posting on the forums.

    In order to run a multi lingual site you can use a plugin like : http://wpml.org/

    However, what you are trying to achieve (a list where it would show links to posts in different languages seems a bit tricky, or its so simple that I am not able to get my head around it.

    Let me discuss this with @Jack Kitterhing and get back to you as he responds.

    Cheers, PC

  • PC
    • WPMU DEV Initiate

    Hey there,

    Thanks for your post. I am still looking to see the best way to get it done.

    IMO, it will require you to create a custom category archive for News category and display permalinks from both the languages.

    I will be back soon with more information.

    Cheers, PC

  • PC
    • WPMU DEV Initiate

    Hiya,

    I just discussed this with my colleague @Ashok

    The best way to do it is as below :

    You need to create new custom fields for Title and Link (for the new language)
    Then you need to modify your plugin to make it show the Title and Link on the frontend

    I have asked Ashok to have a closer look and see if he can provide a quick code snippet here.

    Cheers, PC

  • Ash
    • WordPress Hacker

    Hiya @dzulfriday

    You can use the following code:

    <?php
    // The Query
    query_posts( array ( 'category_name' => 'spanish', 'posts_per_page' => -1 ) );
    ?>
    <table cellpadding="5" cellspacing="5" border="1">
    	<tr>
    		<th>Date</th>
    		<th>English</th>
    		<th>Spanish</th>
    	</tr>
    <?php
    while ( have_posts() ) : the_post();
    	?>
    	<tr>
    		<td><?php echo get_the_date(); ?></td>
    		<td><?php the_title(); ?></td>
    		<td><?php $data = get_post_meta( get_the_ID(), 'ct_Spanish_Ti_text_acae'); echo $data[0]; ?></td>
    	</tr>
    	<?php
    	endwhile;
    	wp_reset_query();
    	?>
    </table>

    In the first line for category_name give your category slug. And change the layout as you wish.

    Cheers
    Ash

  • Ash
    • WordPress Hacker

    In that case you can pass the pages parameter in this way:

    <?php
    // The Query
    if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
    elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
    else { $paged = -1; }
    query_posts( array ( 'category_name' => 'spanish', 'posts_per_page' => 2, 'paged' => $paged) );
    ?>
    <table cellpadding="5" cellspacing="5" border="1">
    	<tr>
    		<th>Date</th>
    		<th>English</th>
    		<th>Spanish</th>
    	</tr>
    <?php
    while ( have_posts() ) : the_post();
    	?>
    	<tr>
    		<td><?php echo get_the_date(); ?></td>
    		<td><?php the_title(); ?></td>
    		<td><?php $data = get_post_meta( get_the_ID(), 'ct_Spanish_Ti_text_acae'); echo $data[0]; ?></td>
    	</tr>
    	<?php
    	endwhile;
    	wp_reset_query();
    	?>
    </table>
    <?php next_posts_link( 'Older posts' ); ?>
    <?php previous_posts_link( 'Newer posts' ); ?>

    Hope it helps! Please feel free to ask more question if you have.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.