• Filmskisan2015

    (@filmskisan2015)


    Hi there,

    I would like to use your plugin A-Z listing on my website to have specific listing of my post for author only, not for category. Do you have shortcode for that?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    The plugin doesn’t do this natively. You can, however, hook into the filter a_z_listing_query using PHP to modify the query by adding the required parameters. Something like below might work when added to your theme’s functions.php file:

    add_filter( 'a_z_listing_query', 'add_user_to_a_z_query' );
    function add_user_to_a_z_query( $query ) {
        $query['author'] = 123; // Set to ID of a user
        // alternatively $query['author_name'] = 'Administrator'; // Set to a user's name
        // alternatively $query['author__in'] = array( 1, 2, 3, 4 ); // Set to multiple ID numbers of users
    
        return $query;
    }
    • This reply was modified 6 years ago by Dani Llewellyn. Reason: fix `author__in` array index
Viewing 1 replies (of 1 total)

The topic ‘listing by author’ is closed to new replies.