searching custom posts exclusively
-
The page in reference is using a shortcode for a PODS template, here is the code for that template below.
<?php
$cat_args = array ( ‘parent’ => 0 ) ;
$parentcategories = get_terms ( “rdrgcat”, $cat_args ) ;
$no_of_categories = count ( $parentcategories ) ;
if ( $no_of_categories > 0 ) {
foreach ( $parentcategories as $parentcategory ) {
echo ‘- <h2>’ . $parentcategory ->name . ‘</h2>
- ‘ ;
- ‘ . $subcategory->name . ‘‘;
echo ‘
$parent_id = $parentcategory ->term_id;
$subcategories = get_terms ( ‘rdrgcat’, array ( ‘child_of’ => $parent_id, ‘hide_empty’ => false, ‘orderby’ => ‘id’ ) ) ;
foreach ( $subcategories as $subcategory ) {
$args = array (
‘post_type’=> ‘questions’,
‘orderby’=> ‘title’,
‘order’=> ‘ASC’,
‘post_per_page’=> -1,
‘nopaging’=> ‘true’,
‘taxonomy_name’=> $subcategory->name
);
echo ‘‘ ;
}
echo ‘‘ ;
}
}
?>What I need to do is add code to do a custom search that only searches the PODS posts, these are in the pods “rdrgs”. I am willing to create an additional pods template and insert the shortcode along with the one used for this template on the page below.
The web address is http://www.iira.org/data-tools/rural-development-resource-guide-2/
The page I need help with: [log in to see the link]
The topic ‘searching custom posts exclusively’ is closed to new replies.