How to Remove Duplicate Dropdown menus for CPT Pod?
-
Hi Pod plugin author,
Background
I am trying to create a dropdown menu for the items in the a CPT pod named course.I have put in the following php code in the function.php file and POD template as the screenshots.
In the Function.php File:
`function wpse34320_type_dropdown( $post_type )
{
$posts = get_posts(
array(
‘post_type’ => $post_type,
‘numberposts’ => -1
)
);
if( ! $posts ) return;$out = ‘<select id=”wpse34320_select”><option>Select a Course</option>’;
foreach( $posts as $p )
{
$out .= ‘<option value=”‘ . get_permalink( $p ) . ‘”>’ . esc_html( $p->post_title ) . ‘</option>’;
}
$out .= ‘</select>’;
return $out;
}In the POD Template
?<?php echo wpse34320_type_dropdown( ‘course’ ,1); ?>
Class Size: {@min_class_size} to {@max_class_size}Problem
However, the dropdown menu is duplicated according to the number of pod items there are. (E.g. 3 courses => 3 dropdown menus).
?
Please see here: https://one-eduworld.com/listings/yamaha-music-school/Advice/ The way forward
I can’t figure out what is the problem despite reading up most of the documentation on the pod website. I will greatly appreciate if you could point me in the right direction to figure things out. Thank you very much!Many thanks,
SandraThe page I need help with: [log in to see the link]
- The topic ‘How to Remove Duplicate Dropdown menus for CPT Pod?’ is closed to new replies.