Title: Driving me CRAZY :(
Last modified: August 19, 2016

---

# Driving me CRAZY :(

 *  Resolved [deckster0](https://wordpress.org/support/users/deckster0/)
 * (@deckster0)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/driving-me-crazy/)
 * I have a very basic function that echoes the Category ID
 *     ```
       <?php
       function get_cat_id_now() {
       	$category = get_the_category();
       	$thecatid = $category[0]->cat_ID;
       	echo $thecatid;
       }
       ?>
       ```
   
 * and then, I want to use the include function together with the get_cat_id_now
   function.
    Like this: `<?php include("/related/".get_cat_id_now().".html"); ?
   >`
 * But it doesn’t work.
    How do I add the `get_cat_id_now()` correctly into the `
   include(/related/function_goes_here.html")` ?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [deckster0](https://wordpress.org/support/users/deckster0/)
 * (@deckster0)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/driving-me-crazy/#post-1376527)
 * Also, I can’t seem to find a function that wp already have for
    getting the cat
   id
 *  Thread Starter [deckster0](https://wordpress.org/support/users/deckster0/)
 * (@deckster0)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/driving-me-crazy/#post-1376532)
 * Anyone? This is a pretty simple question folks 🙁
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/driving-me-crazy/#post-1376538)
 * Don’t echo $thecatid, return it.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Driving me CRAZY :(’ is closed to new replies.

## Tags

 * [category.php](https://wordpress.org/support/topic-tag/category-php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/driving-me-crazy/#post-1376538)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
