0

my plugin code is this

<?php wp_dropdown_categories( 'hide_empty=0' ); ?>

Post Category

thus it display all categories registered

I would like to show only the categories that I want

3
  • 1
    Have you read the Codex entry for wp_dropdown_categories?
    – Milo
    Commented Nov 5, 2016 at 15:48
  • yes, but I'm not able to show only the categories I selected by id he is showing all categories Would you help me? Commented Nov 5, 2016 at 15:52
  • I don't understand where is the problem... Use include argument for wp_dropdown_categories.
    – vol4ikman
    Commented Nov 5, 2016 at 16:08

1 Answer 1

2

This can be done easily using include parameter. Check the documentation of wp_dropdown_categories(). You can pass category id's to include parameter as a array.

 <?php wp_dropdown_categories( 'include=array( 8,39 )' ); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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