Hi Halil,
You can use the below method:
1. In your page hero, add a CSS class to the headline block which represents the search title, eg. search-query
:
https://www.screencast.com/t/aqbOVSpQ3s
2. In the headline block, please include the search query
text, so we can use the below PHP to replace this text with the dynamic search query text, please refer to the screenshot in No.1.
3. Add the PHP code below:
add_filter( 'render_block', function( $block_content, $block ) {
if ( ! empty( $block['attrs']['className'] ) && 'search-query' === $block['attrs']['className'] && is_search() ) {
$search_query = get_search_query();
$block_content = str_replace('search query', $search_query, $block_content);
}
return $block_content;
}, 10, 2 );
Adding PHP: https://docs.generatepress.com/article/adding-php/