-
golinuxcloud
Hello,
I have created Block – Page Hero Element for all my archives and posts using Headline which automatically adds Post and Page Title
But that doesn’t seem to work for
Search Results Title and
404 Page Not FoundFor these two I observed that the title appear inside content area and the block element is not working there.
I took the PHP snippet from https://generatepress.com/forums/topic/search-results-page-element/#post-2399165 page and then I can see atleast the searched string is visible as the title, but I wanted the entire H1 title content visible in the block element instead of content using the CSS as already applied for the title block. For example: “Search Results for: hello” should appear in title when I search for ‘hello’
Similarly for 404 page not found I have created a Content Template so is it possible to have the title of that Content Template appear as Title instead of showing inside Content section?
Are there any other possible scenarios where I would need similar adaptations?
-
Alvind
Hi there,
For simplicity, exclude the current Page Hero Element from displaying on Search Results and the 404 Page. Then, create a specific page hero element for the Search Results page. You can use this snippet within the same topic to achieve what your desired outcome:
https://generatepress.com/forums/topic/search-results-page-element/#post-2401791 -
golinuxcloud
Hello Alvind,
I am not sure how to create a page hero element for search results and what all needs to be added. If there is any sample code which I can use then I can give it a try.
I had checked the article you shared but none of those codes in the article provides what I was looking for.
1. I wanted the complete search title to appear in the place of title in block element. For example: “Search Results for: hello” should appear in title when I search for ‘hello’
2. For 404 also I want similar code which replaces title with the 404 title as it happens for any other post or page title.Regards
Deepak
- You must be logged in to reply to this topic.