Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Calling Post data in WP by hovering a certain word

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #41159
    noahgelman
    Participant

    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?

    #116317
    Watson90
    Member

    Wouldn’t you best using maybe a tooltip plugin for WP?

    #116319
    noahgelman
    Participant

    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.

    #116324
    chrisburton
    Participant

    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.

    #116330
    noahgelman
    Participant

    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?

    #116334
    chrisburton
    Participant

    @noahgelman After doing some research, you might actually be able to do this with PHP. I would post the question on StackOverflow.

    #116343
    noahgelman
    Participant

    I’ll definitely look into it, thanks Chris

    #116394
    chrisburton
    Participant

    @noahgelman if you find the answer there, please post a link here.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Back End’ is closed to new topics and replies.