1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Wordpress Custom Post Type Filter not Working

Discussion in 'Content Management' started by wilyjose, Mar 23, 2014.

  1. #1
    I am pretty new to Wordpress and I have a problem with a filter in custom Post types..

    See screenshot here of what I mean:

    [​IMG]


    Here is the code I am using for the filter
    publicfunction jobs_by_codes( $show_counts =1, $hierarchical =1, $show_uncategorized =1, $orderby =''){global $typenow, $wp_query,$wpdb;
    
    if( $typenow !='job_listing')return;
    
    $r = array();
    $r['pad_counts']=1;
    $r['hierarchical']= $hierarchical;
    $r['hide_empty']=1;
    $r['show_count']= $show_counts;
    $r['selected']=( isset( $wp_query->query['job_code']))? $wp_query->query['job_code']:'';
    
    $r['menu_order']=false;
    
    if( $orderby =='order')
    $r['menu_order']='asc';
    elseif ( $orderby )
    $r['orderby']= $orderby;
    
    $terms = get_terms('job_code', $r );
    
    if(! $terms )return;
    
    $output ="<input type='text' name='job_code' id='input_job_code' value='' placeholder='Jobk Code'/>";
    
    echo $output;}
    PHP:

    Please if someone could tell me what I am doing wrong I would really appreciate.


    Thanks All
     
    wilyjose, Mar 23, 2014 IP