You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have a pod with name "team_member". When using the pods function, it doesn't contain any posts. This is my code and output:
$team_members = pods('team_member');
echo'total: '. ($team_members->total()); //displays 'total: ' - no output from the functionif ( $team_members->total() > 0 ):
while ( $team_members->fetch() ):
echo'hello'; //is never displayedendwhile;
endif;
When using WP_Query I do get the expected output:
$args = (array('post_type' => 'team_member'));
$team_members = newWP_Query($args);
while ($team_members->have_posts()):
$team_members->the_post();
the_title(); //the title of each pod post is displayedendwhile;
Why does the latter work, and the first doesn't?
The text was updated successfully, but these errors were encountered:
You've opened the object, but you didn't give it any parameters, so it's basically just an object with no pointer at that point (like opening the WP_Query without any $args) . At a minimum, you want to set $params = (array('limit' => '-1')); and call the first line as $team_members = pods('team_member',$params);
Describe the bug
I have a pod with name "team_member". When using the pods function, it doesn't contain any posts. This is my code and output:
When using
WP_Query
I do get the expected output:Why does the latter work, and the first doesn't?
The text was updated successfully, but these errors were encountered: