WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have problem. I need insert this wp query $cust_loop = new WP_Query( 'author=123' ); But I cant remove the $args from $cust_loop = new WP_Query($args); And i tried everything like$cust_loop = new WP_Query($args, 'author=123');`

I want show posts only by specific user, Thanks :)

if($typecount>0) {
    class con_latest_reviews extends WP_Widget {
        function con_latest_reviews() {
            /* Widget settings. */
            $widget_ops = array( 'classname' => 'Continuum Latest Reviews', 'description' => 'Displays a single review type by most recent or highest rated. Add multiple widgets for each review type.' );
            /* Widget control settings. */
            $control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => 'con_latest_reviews' );
            /* Create the widget. */
            $this->WP_Widget( 'con_latest_reviews', 'Continuum Latest Reviews', $widget_ops, $control_ops );
        function widget( $args, $instance ) {

            extract( $args );

            /* User-selected settings. */
            $title = apply_filters('widget_title', $instance['title'] );
            $sort = $instance['sort'];
            $reviewtype = $instance['reviewtype'];
            $numreviews = $instance['numreviews'];

            //get review type for More link URL purpose
            $reviewtypeurl = $reviewtype;
            if($reviewtypeurl=="game") $reviewtypeurl="video-game";

            if($sort=="highest-rated") {
            } else {
            } ?>

            <div class="tabdiv reviews <?php echo $reviewtype; ?>">


                /* Before widget (defined by themes). */
                echo $before_widget;

                /* Title of widget (before and after defined by themes). */
                if ( $title ) { ?>                  
                    <?php echo str_replace('<h2 class="gentesque">','<h2 class="gentesque">',$before_title); ?>
                        <div class="icon <?php echo $reviewtype; ?>">&nbsp;</div>
                        <?php echo $title; ?>
                    <?php echo $after_title; ?>
                <?php } 

                /* HTML output */

                    <?php // setup the query
                    $cust_loop = new WP_Query($args); 
                    if ($cust_loop->have_posts()) : while ($cust_loop->have_posts()) : $cust_loop->the_post(); $postcount++;
                        // if we're sorting by rating and this item does not have a rating, hide it
                        $rating = get_post_meta(get_the_ID(), "Rating", $single = true); 
                        if(($rating && $feedsort=="meta_value") || ($feedsort!="meta_value")) {                                     
                            $ratings = con_setup_rating($rating); //setup the ratings array 

                                <?php con_show_rating($ratings[0], $ratings[1], $ratings[2]); // show the stars or hearts ?>    

                                <a class="post-title" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>                                              


                        <?php } ?>
share|improve this question
See here - wordpress.stackexchange.com/a/175746/42702 – tazo todua Jan 23 '15 at 10:12

If all you need to do is add that extra parameter, just concatenate it on to the end of $args. (As a side note: I recommend using an array for args instead of the query string method as I find it much more readable.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.