• Dear all,

    I got one issue. It cost me almost 1 week. still not find the answer, can anybody help me to figure it out? million thx!!!!

    here is the issue:
    I use query to database for listing the categories by special author. it works great by below code:

    <?php
        $author = get_query_var('author');
        $categories = $wpdb->get_results("
        SELECT DISTINCT(terms.term_id) as ID, terms.name, terms.slug, tax.description
        FROM $wpdb->posts as posts
        LEFT JOIN $wpdb->term_relationships as relationships ON posts.ID = relationships.object_ID
        LEFT JOIN $wpdb->term_taxonomy as tax ON relationships.term_taxonomy_id = tax.term_taxonomy_id
        LEFT JOIN $wpdb->terms as terms ON tax.term_id = terms.term_id
        WHERE 1=1 AND (
            posts.post_status = 'publish' AND
    	posts.post_author = '$author' AND
    	tax.taxonomy = 'category' )
    	ORDER BY terms.name ASC
        ");
    ?>
    <ul class="filters option-set inline clearfix" data-filter-group="type">
        <li class="active" data-filter-value="" class="selected">All</li>
        <?php foreach($categories as $category) : ?>
        <li data-filter-value=".<?php echo $category->name ?>">
            <?php echo $category->name; ?>
        </li>
        <?php endforeach; ?>
    </ul>

    but qtranslate seems can’t not translate successfully via query database. It can normally display the translate words, Only if I use get_the_category_list, but it list all categories without by special author.

    plz help me!

The topic ‘qTranslate queries to database’ is closed to new replies.