WordPress.org

Support

Support » Plugins and Hacks » Hacks » [Resolved] WordPress on external Website with use of qtranslate

[Resolved] WordPress on external Website with use of qtranslate

  • Hello together!

    I’m using WordPress for quite a while and am very happy with it’s usage. But now I’ve got a problem with running WordPress on an external Website. Here is my problem:

    I use WordPress for my Blog in 3 languages (german, english and chinese) with the qTranslate plugin. In addition I run a autonomous Website without WordPress, simply by HTML. What I want to do now is showing the 3 last Posts from my Blog on the website’s welcome page.
    This is the code I use for showing the Posts (I found in this board, thanks for that, it is fantastic!)

    <?php
    	#
    	# Die Vollansicht des Blogeintrages
    	#
    	$c = 0;
    
        $args = array( 'numberposts' => 3, 'post_status'=>"publish",'post_type'=>"post",'orderby'=>"post_date");
        $postslist = get_posts( $args );
    
        foreach ($postslist as $post) : setup_postdata($post);
    	$c++;
    	if ($c == 1) { $class = 'style="top:0px;"'; }else{$class = '';}
    	?>
               <div class="cn_content" <?php echo $class; ?>>
              <div class="cn_image"><img src="<?php echo catch_that_image(); ?>" title="<?php the_title(); ?>" height="172px" /></div>
               <div class="cn_articleContent">
               <h1><?php the_title(); ?></h1>
    
               <?php $strings = preg_split('/(\.|!|\?)\s/', strip_tags($post->post_content), 2, PREG_SPLIT_DELIM_CAPTURE);
    			echo apply_filters('the_content', $strings[0] .  $strings[1]); ?>
    
                <p class="cn_date">vom <?php the_date('d. M. Y'); ?></p>
                </div>
    
                <div class="cn_button"><a class="orangeButton" href="<?php the_permalink(); ?>">Zum Artikel</a></div>
    
                </div>
    
    <?php endforeach; ?>

    The website itself is also in 3 languages via different pages ( e.g. pageDE.php, pageEN.php, pageCN.php ). What I want to do now is using 3 inquiries for each language. How can I tell WordPress or qTranslate, that I just want to have posts e.g. in german with the code shown above?!

    Thanks for your help!
    Regards from Germany

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] WordPress on external Website with use of qtranslate’ is closed to new replies.
Skip to toolbar