Title: Problem with gategory ID
Last modified: August 21, 2016

---

# Problem with gategory ID

 *  [bepperine](https://wordpress.org/support/users/bepperine/)
 * (@bepperine)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/problem-with-gategory-id/)
 * Hi
 * i’m trying to use plugin, i create a category and i associate this to a page 
   and many posts. In my page i want page content and posts with the same category.
   I make this
 * $cat = get_query_var(‘cat’);
    $argsText = array(‘category’ => $cat, ‘numberposts’
   => -1, ‘post_status’ => null, ‘post_type’ => ‘post’);
 * $postsText = get_posts( $argsText );
 * But $cat is empty. How can i get the category id of current page??
    Help me please!
 * [http://wordpress.org/plugins/post-tags-and-categories-for-pages/](http://wordpress.org/plugins/post-tags-and-categories-for-pages/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [curtismchale](https://wordpress.org/support/users/curtismchale/)
 * (@curtismchale)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/problem-with-gategory-id/#post-4284887)
 * This is really just a general coding question and will get more answers in the
   general support forums.
 * The `cat` item will only have stuff in it by default on archive pages for categories.

Viewing 1 replies (of 1 total)

The topic ‘Problem with gategory ID’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/post-tags-and-categories-for-pages.
   svg)
 * [Post Tags and Categories for Pages](https://wordpress.org/plugins/post-tags-and-categories-for-pages/)
 * [Support Threads](https://wordpress.org/support/plugin/post-tags-and-categories-for-pages/)
 * [Active Topics](https://wordpress.org/support/plugin/post-tags-and-categories-for-pages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-tags-and-categories-for-pages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-tags-and-categories-for-pages/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [curtismchale](https://wordpress.org/support/users/curtismchale/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/problem-with-gategory-id/#post-4284887)
 * Status: not a support question