Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8207189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:55:13+00:00 2026-06-07T08:55:13+00:00

I have a very simple plugin: add_action(‘pre_get_posts’, ‘post_page’); function post_page() { global $wp_query; if(is_category())

  • 0

I have a very simple plugin:

add_action('pre_get_posts', 'post_page');

function post_page()
{

 global $wp_query;      
 if(is_category())
 {
    echo '<pre>';
    print_r($wp_query);
    exit;
 }

}

I have to get the category ids within my plugin. I am getting without SEO urls but category__in is empty with SEO urls

Without SEO friendly url (category__in not empty) :

http://phpxpert.com/?cat=3

With seo friendly url (category__in is empty):

http://phpxpert.com/category/jquery/

Why this is happening and how can I get post_id and category_ids in my plugin?

thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T08:55:14+00:00Added an answer on June 7, 2026 at 8:55 am

    You’ll probably find the category being used in the category_name variable. You can then use get_term_by to get more information about the category.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a very simple NSIS plugin that has one function in it.
I have recently done a very simple highlighting with jQuery and a highlight plugin.
I have downloaded an audio player plugin for WP. the syntax is very simple.
Very simple question! ha? I can't download the latest version of GalleryView plugin.I have
I have written an Interface for writing a very very simple Plugin. In fact
I have very simple window where I have 2 buttons - one for cancel,
I have a very simple webforms app that will allow field techs to order
I have some very simple XML: <properties> <property> <name>BobFish</name> <explaination>Bob is a fish.</explaination> </property>
I have a very simple Setup project that copies three dlls into the GAC.
I have a very simple table with two columns, but has 4.5M rows. CREATE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.