Calling pods data into a sidebar widget

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  mrappleton 2 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #163641

    mrappleton
    Member

    I have a problem: I’m trying to pull some pods data into a sidebar widget. I have set up a plugin which creates and registers the widget in WordPress, but when I add the following code to initiate my pods data, I get the following error message:

    Fatal error: Call to a member function findRecords() on a non-object in C:webserverpublic_htmlaelwp-contentpluginssidebar-plugin.php on line 39

    Here is an excerpt of the code I’m using to get the data:

    It seems that the Pod() method is not registering when I call it from within my plugin – can anyone offer any help on this?

    Thanks in advance!

    #163642

    Fike
    Participant
    Post count: 2

    As i understand, $orderby returns date ASC without apostrophes, so you should try putting them inside findRecords().

    The second thing – you are calling events pod as $events, and then you try to apply findRecords on $portfolio.

    #163643

    mrappleton
    Member

    Head slap

    Don’t you hate it when people ask stupid questions without fully checking their code? My only excuse is that I was tired.

    Anyway, it works now so thank you! Also, for reference the $orderby clause works without the apostrophes in findrecords().

    Thanks again for your help.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Wordpress Cloud Hosting