views:

24

answers:

1

I made a custom post loop query based on data from another plugin.

I get this error:

Fatal error: Call to a member function have_posts() on a non-object

Here is the code I have made:

A: 

You assign the select to $most_viewed var, but then you want to pass $sql variable. In the beginning, change $most_viewed = to $sql = ...

leafnode