Display Pods data by category
-
I’m working with Pods to set up a “Projects” section on a website. I have everything set up with 3 categories of projects. I would like to have a main display page like this:
Current Projects
[list of Current Projects data from pods here]Coming Soon
[list of Coming Soon projects data from pods here]Past Projects
[list of Past Projects data from pods here]Here is the code I have now:
<?php $params = array( ); $project = new Pod(‘projects’, $params); $project->findRecords(‘ID ASC’); $total_projects = $project->getTotalRows(); echo $total_projects; ?> <div class=”projects category”> <h1><?php echo get_cat_name(7); ?></h1> <p><?php echo category_description(7); ?></p> <?php if( $total_projects>0 ) : ?> <?php while ( $project->fetchRecord() ) : ?> <?php $project_cat = $project->get_field(‘category.name’); $project_name = $project->get_field(‘name’); $project_description = $project->get_field(‘short_description’); $post_id = $project->get_field(‘ID’); $image_id = get_post_thumbnail_id($post_id); $image = wp_get_attachment_image_src($image_id,’full’); $image_url = $image[0]; ?> <div class=”col2″> <div class=”col2″> ” /> </div> <div class=”col2″> <p class=”category”><?php echo $project_cat; ?></p> <h1 class=”proj”> <?php echo $project_name; ?> </h1> <div class=”proj-desc”> <?php echo $project_description; ?> </div> <p class=”more-link”>display( ‘permalink’ ); ?>”>Learn More</p> </div> </div> <?php endwhile ?> <?php endif ?> </div>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Display Pods data by category’ is closed to new replies.