• Hello,

    I would like to get certain normal posts together with certain custom posts. Currently i get them via:

    <?php
                        $args = array(
                            'category_name' => 'work, travel',
                            'posts_per_page' => 100
                        );
                    $query = new WP_Query($args);
                    ?>

    AND

    <?php
                    $args = array(
                        'post_type' => array(LEXICON, EVENT),
                    );
                    $custom_query = new WP_Query($args);
                    ?>

    seperately. What is the best way to get one stream with the categories work, travel as well as the categories EVENT, LEXICON merged together?

    Thank you in advance!

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    If I understand you correctly, you want all post post types of work and travel categories along with all lexicon and event post types in any category, all via a single query, yes?

    If so, WP_Query is not setup to handle such a query. If you know enough mySQL to write such a query (I don’t), you could use the $wpdb query object to make your mySQL query, which would yield the results you desire in a single query, assuming you wrote the query correctly ??

Viewing 1 replies (of 1 total)
  • The topic ‘Get normal an custom posts in one stream’ is closed to new replies.