- This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
For example:
I create a custom post type called “keyword”
I create a keyword post called “apple” and type in some content.
Now, when I create a regular post, and I use the word “apple” in the content and I hover over it, I want to be able display the “keyword apple” content in some kind of box.
The custom post part is easy. I just need help calling forth the keyword information when I use the matching keyword in a regular post. Does that make sense?
Wouldn’t you best using maybe a tooltip plugin for WP?
Not really, I want the content shown to be database driven. I want to type it’s information once and use it anywhere. Also I want to use html inside as well.
AJAX might be the answer here. Or you can grab the content from outside the loop and initially hide it. And when the user hovers the keyword, display it. Not sure if that’s all possible via PHP alone.
Ajax certainly a possibility.
How’s this: I would run the content through a filter to wrap known “keywords” in a span with a class or something, then, ajax in the content of the matching post when a hover of that word is triggered.
Does that sound like a solid game plan or is there a better way you think?
@noahgelman After doing some research, you might actually be able to do this with PHP. I would post the question on StackOverflow.
I’ll definitely look into it, thanks Chris
@noahgelman if you find the answer there, please post a link here.