Browser: Safari, Arc, Chrome
OS: macOS
URL: Get Your Game On with the Coffee and Board Games T-Shirt | Zandalus Nerd Shop
I created a custom loop option for related products:
function setup_bricks_query($control_options): array
{
$control_options['queryTypes'][RELATED_PRODUCTS_ID] = esc_html__( 'Related Products' );
return $control_options;
}
function run_custom_queries($results, $query_obj ) {
if ( $query_obj->object_type === RELATED_PRODUCTS_ID ) {
$settings = $query_obj->settings;
$results = run_related_products_query($settings);
}
return $results;
}
The query is working fine, and itās returning the results I want. Even when I print a log of the results, all datas are correct.
The problem is that when I do the query loop of the custom type, all headings refer to the page Iām on instead of the queried content. The problem appears only when Iām using a custom loop. If I use the standard āPost, User, etc.ā loop everything works fine.
In this image:
I did put a sign on every heading component Iām using in this loop. As you can see, all headings refer to the page Iām on, while the basic text correctly refers to looped content and gets the right result.
The structure of this part is really simple:
Iāve tried changing run_related_products_query, but I donāt think thatās the problem, because the log always returns the right results, and the non-heading components are reading the correct result.
Iām here in case you need some more information.