pod loop not pulling custom post type
-
I started using pods for the first time, and while I was excited, I’m having a hard time getting the loop to work. The idea is to display a custom post type created called Home Section with which I’ve created custom fields. As of right now, the variable isn’t showing as existing but this is the closest I’ve come to having anything function using the pod loop.
<?php
$mypod = pods(‘home_section’);
if( $mypod->exists() ){
$title = $mypod->display(‘title’);
echo $title;}
else {
echo ‘This is alll wrong!’;
}?>
The good news is, I’m at least getting the else on my if/else loop. I’ve tried many different strategies to call home_section and nothing has worked. Any suggestions would be helpful. I’ve tried calling an array and running ->find() on the array, I’ve tried fetch(), I’ve tried $mypod = pods(‘home_section’, get_the_ID()), but nothing is working unless I run a wp_query loop setting my custom post type in an array. That works great but I don’t access to the full functionality that pods has to offer. I appreciate any and all help.
The topic ‘pod loop not pulling custom post type’ is closed to new replies.