maithemewp / mai-engine

Other
17 stars 3 forks source link

mai_site_layout() gets wrong result on single posts when Mai Post Grid is used on the page. #633

Closed JiveDig closed 1 year ago

JiveDig commented 1 year ago

This took forever to find and is related to this commit https://github.com/maithemewp/mai-engine/commit/a570d015ba52755d5e6dada187c8b90acbc80e47, though it turns out that isn't a solid fix.

The issue is actually caused by mai_get_image_src_srcset_sizes calling wp_calculate_image_sizes during the preload of featured/logo/images.

So far, it looks like calling get_queried_object_id() makes sure we get the actual single post ID and not the ID from inside the loop in Mai Post Grid.