Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Please help me I am new baby in wordpress, how can i hide that 'course or call' category from the page..

i have var dump the variable which is passing as parameter to query_post

        $args = jr_filter_form();
        var_dump($args);
        query_posts($args);

enter image description here

this category is having tag_ID="65" in its url , which i have seen in wordpress dashboard, job category page please help me a little thanks

share|improve this question

3 Answers 3

You essentially want to add the following to $args:

'cat' => -65

One way to to this is to add the following line after $args = jr_filter_form();:

$args['cat']= -65;

Note the - will exclude that particular category ID from the results.

Reference: WordPress codex - query_posts() (see: "Exclude Categories From Your Home Page")

--

Additional Notes:

Admittedly, I'm not too familiar with the jr_filter_form(). It seems like you are using http://www.appthemes.com/themes/jobroller/ ... they may already offer a built-in solution to customize the results, but I'm not a member so I can't tell :)

share|improve this answer
    
thanks , but that doesnt work –  zan Jan 26 '13 at 8:37
    
Perhaps I should've asked this from the beginning, but just for clarification - are you stating 65 is the ID for Masters in Environmental Journalism? And do you just want to hide that particular category (i.e. 65), or the entire Course or call field in general? –  Christian Rios Jan 26 '13 at 15:49
    
i want to hide Course or call field not Masters in Environmental Journalism? –  zan Jan 27 '13 at 13:45

You can hide categories from query on your functions.php file too. Try this:

add_action( 'parse_query', 'wpse_35077_cat_excluder' );
function wpse_35077_cat_excluder( $query ) {

    if( !empty( $query->query_vars['post_type'] ) )
        return;

    if( is_home() ) // Just home page
        set_query_var('category__not_in', array( 65 ) ); // ID of the categories that should not be displayed
}

Change the conditional is_home() to the page you want to hide the category or remove line to hide the category in all pages.

Read Conditional Tags on Wordpress Codex.

share|improve this answer

Thanks u guys , your views help me to analyse

i have added this lines and it works thanks u all,

$args = array_merge(
            array(
                'job_type' => 'Jobs'
            ),
            $args
        );

        query_posts($args);
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.