Archived topic
Add intro text to various search results pages?
5 replies · Started by Stephen on July 1, 2021
My site is a directory. I present organizations/websites and explain them (each is a post). Users review/rate them.
I'm trying to figure out the best nav strategy. I thought of using a single nav button with a dropdown of post categories/tags. They would take users to the archive pages for each of those categories. But I want to style it like a search box and add a "Go" button.
So maybe I could just use a search box instead...
Here's the question. Let's say I use a search box with dropdown of categories/tags (user can't type in random word). Let's say one of the categories is "online movies". Go. Ajax shows a page of results (by cat or tag). Is there a way for me to add intro text about online movies on that results page? If I have a "streaming radio" category in the dropdown, I would want to add intro text about streaming radio to its results page.
Different intro text for different results pages. Is it possible?
Or would it be easier to just use a nav button with dropdown and somehow add a "go" function to it? (Since I know there's way to add intro text to each category page, might be easier than adding to results pages).
Sorry for long post.
Hi there,
if i read it correctly, aside of the Styling of the nav element it sounds like the user would be taken to the relevant Taxonomy Term Archive.
If thats the case the you can use a Block Element:
https://docs.generatepress.com/article/block-element-overview/
Which can be hooked into the Category Archives for example
And for dynamic data you could get the Category Description using the GP Dynamic Content Block:
https://docs.generatepress.com/article/dynamic-blocks/
And for other Term Meta ( Custom Fields ) you can use any of the dynamic data types with GenerateBlocks plugin:
Okay, so I create a block element under the header, and link it to a category archive. (will be a different block for each category archive.) Then I add a Dynamic Content Block to that which will pull the description (I guess the one I add in the category area of WP dashboard) into the block. Then, when I figure out the nav button deal, the user can click on "online movies" and will be taken to the "online movies" category archive page. That page will show the intro text, in this case it's the category title and description, which was added to the block.
Do I understand?
It also looks like I can add previous post/next post links and featured images under posts this way. Neat.
Hi Stephen,
I think you understand it correctly :)
Here's a tutorial video on how to create a page hero with dynamic blocks, should be helpful:
https://youtu.be/yq6VcgU3Ufg
Thanks.
You are welcome :)