Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ah, that’s exactly what’s happening! We have a custom a_z_listing_item_indices filter in place. I added your fix to our filter, and that sets things up properly now.

    The only other issue is that in “get_the_item_object”, the item is exploded out with the ‘:’ delimiter, but it’s set to return only 1 item in the array instead of the needed 2.

    If you change the limit parameter to 2, everything works fine:
    $item = explode( ':', $this->current_item['item'], 2 );

    Thanks for the help.

    To follow up on this issue, we’ve found that:
    $post = $a_z_query->get_the_item_object( 'I understand the issues!' );
    does not properly load the post object when querying custom post types (or maybe all post types.) So post thumbnails do not populate.

    In the method “get_the_item_object”, the second line –
    $item = explode( ':', $this->current_item['item'], 1 );
    doesn’t work where $this->current_item[‘item’] is a WP_Post object, and $item ends up being null, so nothing happens in the method.

    Short-circuiting the method by inserting the following at start of “get_the_item_object” fixes the method for CPTs at least:

         global $post;
         $post = get_post( $this->current_item['item'] );
         setup_postdata( $post );
         return $post;
Viewing 2 replies - 1 through 2 (of 2 total)