Support » Plugins » Widget and page with a query based on custom fields in PHP, got error message

  • Hello!
    I’m after a solution to make a query and printout where I can choose what to show based on some Custom Fields (for example date, race, place and so on).
    I found the code below on WordPress homepage:
    http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query

    I’m try to use it in a widget and in page.
    I have installed PHP-exec and can do for example echo (‘Hello World!’);

    But with the code below I get error messages like this:
    Fatal error: Call to a member function get_results() on a non-object in

    The code on error line is:
    $pageposts = $wpdb->get_results($querystr, OBJECT);

    I have saved in the database so the custom field is there, tag->email

    I thougt of this as a good way to show what I wanted and get it customized…

    Maybe if there isn’t a solution on this, an idea of a way to solve it in other ways?

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Widget and page with a query based on custom fields in PHP, got error message’ is closed to new replies.