Show the name of the post type in the seaarch result

Hello, I want to set up a search result page and show a little label that indicates, which post type the search result belongs to, like this is a Page, this ist a Post, this is a Custom Post type like “Projects” I created. Which dynamic data tag I should use?

Can’t find anything that does that …

{echo:get_post_type} 

you will have to add this to your theme functions file:

add_filter( 'bricks/code/echo_function_names', function() {
  return [
    'get_post_type',
  ];
} );

BTW, Marcio helped me with this on another forum; I’m just sharing :wink:

Awesome, thank you! Also to Marcio :slight_smile:

How can I do this, but show the name of the Post Type rather than the slug? For example, I have a CPT called “News Release”. Right now it’s displaying “news-release” which is the slug. I’d like to show the name “News Release” instead.