Ess Grid show posts and pages in the author.php template

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).']' ); 
    
    
  ?>

Hello @FrodX,

Thanks for writing to us.

Please note that we don’t provide custom development support. It is out of the support scope. I would suggest you contact a developer who can assist you with your concern or you can avail of our service called One, where the customization questions are answered.

Thanks for understanding

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.