• Resolved bowersinit

    (@bowersinit)


    hey, ive tried searching about for the answer to this, apologies if ive missed it somewhere, but here goes.

    basically i have a site running en and fr, i have written a plugin that exports every post in a custom post type (wh_property) into to an xml file, it outputs all the data in the sites default language (in this case en), i would like to output both languages instead, ive found the data in the db and its being stored like this:

    [:en]EN content[:fr]FR content[:]

    but when it outputs, it only outputs the EN content, im using the following code to do this:

    $args = array(
    	'post_type' => 'wh_property',
    	'posts_per_page' => '200',
    	'orderby' => 'date',
    	'order'   => 'DESC',
    );
    
    $qry = new WP_Query( $args );
    
    $posts = $qry->get_posts();
    foreach($posts as $poster) {
    
    	...more code above...
    
    	$main_content = $poster->post_content;
    
    	$output_xml .= '<description>'.$main_content.'</description>';
    
    	...more code below...
    }

    so basically im looking for a way to output all the post content, rather than just one language, is this possible?? thanks in advance

    https://www.ads-software.com/plugins/qtranslate-x/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘output all languages, instead of just site default’ is closed to new replies.