Open tomusborne opened 1 year ago
The post meta is displaying (or not) based on the first post in the loop.
The post meta display should always be based on the individual post type.
This is happening because we're checking get_post_type() in the wp hook, which will grab the post type of the first post only.
get_post_type()
wp
A potential solution:
add_action( 'generate_before_content', function() { if ( is_search() ) { $header_items = generate_get_header_entry_meta_items(); $header_post_types = apply_filters( 'generate_entry_meta_post_types', array( 'post', ) ); if ( ! in_array( get_post_type(), $header_post_types ) && ! empty( $header_items ) ) { remove_action( 'generate_after_entry_title', 'generate_post_meta' ); } } } );
https://generate.support/topic/last-updated-date-in-internal-search-results/#post-28191 https://generate.support/topic/last-updated-date-in-internal-search-results/page/2/#post-28405
Description
The post meta is displaying (or not) based on the first post in the loop.
Steps to reproduce
Actual behavior
Expected behavior
The post meta display should always be based on the individual post type.
This is happening because we're checking
get_post_type()
in thewp
hook, which will grab the post type of the first post only.A potential solution:
References
https://generate.support/topic/last-updated-date-in-internal-search-results/#post-28191 https://generate.support/topic/last-updated-date-in-internal-search-results/page/2/#post-28405