Use custom get results query to show posts WordPress

You can get same result by outputting values from PHP array. Since it is multicolumn array, you will need to run foreach loop and get values of each child item.

Mostly it’s standard PHP stuff, nothing special. Although earlier you did not need to supply post ID in each WordPress function since you were using it inside a loop, but now you will have to do that.

So here is the output.

foreach( $getAllTimeRows as $getAllTimeRow ) {

    $post_id_num = $getAllTimeRow->post_id;

    echo '<a class="popularPostLinks" href="' . get_permalink( $post_id_num ) . '" rel="external" target="_blank">' . get_the_post_thumbnail( $post_id_num ) . '<br>
        <div>
            <p>' . get_the_title( $post_id_num ) . '</p>
        </div>
    </a>';

}