Title: Use get_categories() in function.php
Last modified: August 21, 2016

---

# Use get_categories() in function.php

 *  Resolved [ivanbarlog](https://wordpress.org/support/users/ivanbarlog/)
 * (@ivanbarlog)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/use-get_categories-in-functionphp/)
 * Hi,
    I want to create responsive design for my WP so I want to create custom 
   dropdown category theme for mobile devices. I have got code which actually working
   but now I want to create function in file functions.php so I can call this custom
   dropdown menu wherever I want.
 * So far I have got this code [http://pastebin.com/bcrLAYhi](http://pastebin.com/bcrLAYhi)
 * If I copy code within function to template file it is working but when I call
   the function from functions.php file it isnt generating any <option> tags.
 * Could someone get me some hint how to edit this function so it can reach categories
   used in my WordPress instance? I assuming that function get_categories() is not
   working properly in functions.php

Viewing 1 replies (of 1 total)

 *  Thread Starter [ivanbarlog](https://wordpress.org/support/users/ivanbarlog/)
 * (@ivanbarlog)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/use-get_categories-in-functionphp/#post-4304170)
 * I am sorry, it is working.
    I forget echo it … Shame on me

Viewing 1 replies (of 1 total)

The topic ‘Use get_categories() in function.php’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [ivanbarlog](https://wordpress.org/support/users/ivanbarlog/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/use-get_categories-in-functionphp/#post-4304170)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
