Site logo

Archived topic

Page Header titles in Search and Not Found

3 replies · Started by Iban on April 24, 2018

Viewing posts 1–4 of 4

I would love to use {{post_title}} for search results and not found / 404 page titles too

Now those titles appears in the content and {{post_title}} gets empty

I would love the same behavior as it works in archives right now

I think the only proper way would be modifying the plugin because doing [my_own_title_shortcode] seems to break everything and confuse titles or something...

Great

Done this for the new Search Header to show it in my language

function mi_search_func() {
  return sprintf( __( 'Search Results for: %s', 'generatepress' ), '<span>' . get_search_query() . '</span>' );
}
add_shortcode('mi_search', 'mi_search_func');

and then css for removing the actual title that is not removed automactly:

.search .page-header {
    display: none;
}

Finishing i created a new Page Header for 404. Sounds weird having so much copies of the "same" header but offer much more flexibility in design. I think everything is ok...

Many Thanks!

Glad you've figured it all out!

This archived topic is closed to new replies.