tjebe
Forum Replies Created
-
Forum: Plugins
In reply to: [A-Z Listing] URGENT! NEW FEATURE NEEDED – A-Z by posts with ThumbnailsAh, 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.
Forum: Plugins
In reply to: [A-Z Listing] URGENT! NEW FEATURE NEEDED – A-Z by posts with ThumbnailsTo 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;