Custom post template page
-
Hi,
I’m looking to create a template page to display custom post type content
I have a form:
<form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>"> <h5>type:</h5> <?php wp_nonce_field( plugin_basename( __FILE__ ), 'types_noncename' ); $type_IDs = wp_get_object_terms( $post->ID, 'Types', array('fields' => 'ids') ); wp_dropdown_categories('taxonomy=Types&hide_empty=0&orderby=name&name=Types&show_option_none=Selectionnez un type&selected='.$type_IDs[0]); ?> <h5>year:</h5> <?php wp_nonce_field( plugin_basename( __FILE__ ), 'year_noncename' ); $type_IDs = wp_get_object_terms( $post->ID, 'Year', array('fields' => 'ids') ); wp_dropdown_categories('taxonomy=Year&hide_empty=0&orderby=name&name=Year&show_option_none=Year&selected='.$type_IDs[0]); ?> <span class="input-group-btn2"> <button class="btn2 btn-search2" type="submit">search <i class="fa fa-search"></i></button> </span> </form>
I have also a WP_Query
<?php // set up or arguments for our custom query $paged = ( get_query_var('page') ) ? get_query_var('page') : 1; $query_args = array( 'post_type' => 'mycustompost', 'posts_per_page' => 25, 'order' => 'DESC', 'paged' => $paged ); // create a new instance of WP_Query $the_query = new WP_Query( $query_args ); ?>
And a loop to display each posts
I have thousands of documents. My dropbox allow to select parameters to filters content with custom taxonomies terms.
Today I got Wrong url on my search button to pass filter parameters . How can I solve that ?
How can integrate combobox/dropdown filter into my query parameters ?
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Custom post template page’ is closed to new replies.