Hi!
I am using your provided code to show Ess Grid posts outside “the loop” (found here https://www.themepunch.com/faq/auto-populate-grid-for-archive-pages/), which works as intended.
But now I’d also like to add all the PAGES that belong to the author, not just blog posts. I’m pretty sure that should be possible, but I need your help.
My code:
<?php
if(is_tag()) $my_posts = get_posts(array('tag' => get_query_var('tag')));
else if(is_author()) $my_posts = get_posts(array('author' => get_query_var('author')));
else if(is_date()) $my_posts = get_posts(array('m' => get_query_var('m')));
else $my_posts = get_posts(array('cat' => get_query_var('cat')));
$my_post_ids = array();
foreach($my_posts as $post) {
array_push( $my_post_ids, $post -> ID );
}
echo do_shortcode( '[ess_grid alias="author" posts='.implode(',', $my_post_ids).']' );
?>