• Resolved eberkland

    (@eberkland)


    HI, I’m new to the database query game.

    I have this query that selects posts for use in a database filter calculation:

    SELECT post.post_title,post.post_excerpt,post.post_date,post.guid,user.display_name FROM {wpdb.posts} post INNER JOIN {wpdb.users} as user ON (post.post_author=user.ID) WHERE post.post_title LIKE “%<%fieldname2%>%” OR post.post_excerpt LIKE “%<%fieldname2%>%” OR post.post_content LIKE “%<%fieldname2%>%”

    I just want to call my custom posts. My custom post name is price_book. How would I do this.

    I would greatly appreciate any help.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Out of curiosity, is there any reason why you’re not using the WP_Query class to pull some posts?

    Beyond that, this feels like a search query for posts by the current user. What is fieldname coming from?

    Beyond that that, not really a topic that our plugin necessarily covers, as our purpose is to get the content types registered, not so much what gets done with the content afterwards.

    Thread Starter eberkland

    (@eberkland)

    I found another direction to go since my question, but still am having issues.

    I am creating a pricing calculator using the calculated field form plugin and I want to create a pop up on the page that shows posts related to the product being priced.

    The plugin allows for setting variables on pages and then calling them, but this is not working. I am wondering if it is because the pages I am referencing are custom post types… here is some details on how this plugin sets variables https://cff.dwbooster.com/documentation/#javascript-variables

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    This is going to be a question better fit for the Calculated Fields Form developers than us. They know the capabilities of their plugin way more than we do, including if it’d be possible to use content types the way you’re trying to do things with.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.