Title: Calling is_home() or is_archive() too early
Last modified: August 1, 2025

---

# Calling is_home() or is_archive() too early

 *  Resolved [Mohammad Ali](https://wordpress.org/support/users/mansourikhah/)
 * (@mansourikhah)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/plugin-error-234/)
 * Hi, this plugin causes these two errors.
 * [01-Aug-2025 11:17:44 UTC] PHP Notice: Function is_home was called **incorrectly**.
   Conditional query tags do not work before the query is run. Before then, they
   always return false. Please see [Debugging in WordPress](https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/)
   for more information. (This message was added in version 3.1.0.) in /home/X/public_html/
   X/wp-includes/functions.php on line 6121
 * 
   [01-Aug-2025 11:17:44 UTC] PHP Notice: Function is_archive was called **incorrectly**.
   Conditional query tags do not work before the query is run. Before then, they
   always return false. Please see [Debugging in WordPress](https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/)
   for more information. (This message was added in version 3.1.0.) in /home/X/public_html/
   X/wp-includes/functions.php on line 6121
    -  This topic was modified 10 months, 1 week ago by [Mohammad Ali](https://wordpress.org/support/users/mansourikhah/).
    -  This topic was modified 10 months, 1 week ago by [Mohammad Ali](https://wordpress.org/support/users/mansourikhah/).

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

 *  Plugin Author [Bowo](https://wordpress.org/support/users/qriouslad/)
 * (@qriouslad)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/plugin-error-234/#post-18581576)
 * [@mansourikhah](https://wordpress.org/support/users/mansourikhah/) there is no
   mention of ASE in the error log entries you copied. What led you to believe that
   these two errors are related to / is caused by ASE?
 *  Thread Starter [Mohammad Ali](https://wordpress.org/support/users/mansourikhah/)
 * (@mansourikhah)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/plugin-error-234/#post-18581580)
 * [@qriouslad](https://wordpress.org/support/users/qriouslad/) I disabled the plugin
   and the error was resolved.
 *  Thread Starter [Mohammad Ali](https://wordpress.org/support/users/mansourikhah/)
 * (@mansourikhah)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/plugin-error-234/#post-18581592)
 * [@qriouslad](https://wordpress.org/support/users/qriouslad/), check this code,
   I think this is the problem. (code-snippets-manager.php)
 *     ```wp-block-code
       // Found in code-snippets-manager.phpprivate function location_page_type( $operator, $conditional_page_type ) {    if ( is_front_page() ) {        $actual_page_type = 'is_front_page';    } elseif ( is_home() ) { // Problem call        $actual_page_type = 'is_home';    } elseif ( is_singular() ) { // Problem call        $actual_page_type = 'is_singular';    } elseif ( is_author() ) { // Problem call        $actual_page_type = 'is_author';    } elseif ( is_date() ) { // Problem call        $actual_page_type = 'is_date';    } elseif ( is_archive() ) { // Problem call        $actual_page_type = 'is_archive';    }     // ... and so on}
       ```
   
 * This function is used by the plugin to decide whether to display a CSS, JS, or
   HTML snippet based on its “Conditional Logic” settings. While the plugin tries
   to run this logic on hooks that are usually safe (like `wp_head`), another plugin
   or your theme might be triggering those hooks in a context where the main query
   isn’t finalized, leading to the “incorrectly called” notice.
 *  Thread Starter [Mohammad Ali](https://wordpress.org/support/users/mansourikhah/)
 * (@mansourikhah)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/plugin-error-234/#post-18581659)
 * The plugin conflict with **WooCommerce Memberships**.
 *  Plugin Author [Bowo](https://wordpress.org/support/users/qriouslad/)
 * (@qriouslad)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/plugin-error-234/#post-18583919)
 * [@mansourikhah](https://wordpress.org/support/users/mansourikhah/) since you’re
   using the Pro version of ASE, please login to [your account](https://www.wpase.com/dashboard/)
   and open a support ticket there. This wp.org forum is strictly for supporting
   the free version of ASE, per the forum guidelines. Thank you. p.s. please also
   explain in the ticket why you think the problem is due to a conflict with Woo
   Memberships.
 *  Thread Starter [Mohammad Ali](https://wordpress.org/support/users/mansourikhah/)
 * (@mansourikhah)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/plugin-error-234/#post-18584743)
 * [@qriouslad](https://wordpress.org/support/users/qriouslad/) Disabling either
   of these two plugins will clear the error.
   You’re right, but I’ve said what was
   necessary here and I don’t have the patience for these obvious questions.
 *  Thread Starter [Mohammad Ali](https://wordpress.org/support/users/mansourikhah/)
 * (@mansourikhah)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/plugin-error-234/#post-18584944)
 * [@qriouslad](https://wordpress.org/support/users/qriouslad/) This plugin has 
   many more incompatibilities with WooCommerce Membership.
   This plugin causes the
   Woo Membership Plan to have a duplicate slug.
 * This is a screenshot with ASE activated.
 * ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcTTgkdLqeTwdzfLJnYBsCNTVx6Gci0gAYO1DFuJKB426kz53rdqGzEHn865NAz11PAvabhqxmV2376cf32ZJhFSfPAGSbsjRfbRDywPqGUp8PAOMvzEn2_mir-
   tOrXHtrRbfzD?key=gA7KALX2RiR_-4mqw6xoSQ)
 * This is a screenshot with ASE deactivated.
 * ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcOfFbIFiURFmp_a3ki8YlniNnEBmek9a-
   MBRmfcWJIFfsqQyl5ecacG0QUTHZqUbWA_2eNGrESjOMv-wLzlfiFpT9c5xtkaXZB7TusenXAtqdX3lkGMnIprNqFoJR4XoIyDcVH-
   A?key=gA7KALX2RiR_-4mqw6xoSQ)
 *  Plugin Author [Bowo](https://wordpress.org/support/users/qriouslad/)
 * (@qriouslad)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/plugin-error-234/#post-18585295)
 * [@mansourikhah](https://wordpress.org/support/users/mansourikhah/) thank you 
   for the additional info. Bug-fixing is often times not a simple process. The 
   first goal is to be able to identify the steps to reliably reproduce the bugs.
   For now, this is well-noted. Thank you for your patience. I suggest following
   up by opening a support ticket via [your account](https://www.wpase.com/dashboard/)
   if you’re still interested to elaborate / discuss further. I understand if you’re
   not willing / able.

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

The topic ‘Calling is_home() or is_archive() too early’ is closed to new replies.

 * ![](https://ps.w.org/admin-site-enhancements/assets/icon-256x256.png?rev=3099794)
 * [Admin and Site Enhancements (ASE)](https://wordpress.org/plugins/admin-site-enhancements/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/admin-site-enhancements/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/admin-site-enhancements/)
 * [Active Topics](https://wordpress.org/support/plugin/admin-site-enhancements/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/admin-site-enhancements/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/admin-site-enhancements/reviews/)

## Tags

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

 * 8 replies
 * 2 participants
 * Last reply from: [Bowo](https://wordpress.org/support/users/qriouslad/)
 * Last activity: [10 months, 1 week ago](https://wordpress.org/support/topic/plugin-error-234/#post-18585295)
 * Status: resolved