Viewing 1 replies (of 1 total)
  • Thread Starter timbunch

    (@timbunch)

    So, I hacked the method to obtain the user slug by capturing the URI.

    $slug = $_SERVER['REQUEST_URI'];
    $slug = str_replace('author', '', $slug);
    $slug = str_replace('/', '', $slug);

    I plugged this into the $args variable for the wp query.

    $args = array(
        'post_type' => 'posts',
        'posts_per_page' => 10,
        'post_status' => 'publish',
        'tax_query' => array(
            array(
                'taxonomy' => 'author',
                'field' => 'slug',
    	    'terms' => $slug,
            ),
        ),
    );

Viewing 1 replies (of 1 total)
  • The topic ‘List Posts By A Co-Author Not Working’ is closed to new replies.