Is Base Page?
Use this:
// To detect if AnsPress if( is_anspress() ){ // This is AnsPress. } // To detect if main page if(get_query_var( 'ap_page' ) == '' || get_query_var( 'ap_page' ) == 'base'){ // This is main base page. }
![](https://lh6.googleusercontent.com/-svD3i5kZ5Eo/AAAAAAAAAAI/AAAAAAAAADM/hKTkXkMkztI/photo.jpg?sz=200)
Rahul Aryan commented
Updated my answer.
![](https://lh6.googleusercontent.com/-svD3i5kZ5Eo/AAAAAAAAAAI/AAAAAAAAADM/hKTkXkMkztI/photo.jpg?sz=200)
Brent_Phillips commented
Rahul, sorry this took me so long to get back to you on. I updated to latest version and get_query_var( ‘ap_page’ ) appears to be blank, on the base page and on the question page, so much like the original answer anything within the IF block is executed on all anspress pages.
Rahul Aryan commented
![](https://lh6.googleusercontent.com/-svD3i5kZ5Eo/AAAAAAAAAAI/AAAAAAAAADM/hKTkXkMkztI/photo.jpg?sz=200)
Brent_Phillips commented
Unfortunately that doesn’t appear to distinguish between the question list page and the other anspress pages.
Still struggling to figure this.
![](https://lh6.googleusercontent.com/-svD3i5kZ5Eo/AAAAAAAAAAI/AAAAAAAAADM/hKTkXkMkztI/photo.jpg?sz=200)
Brent_Phillips commented
Thank for your help Rahul, finally got this using a combination of answers:
if( is_anspress() && !get_question_id() && (get_query_var( ‘ap_page’ ) == ” || get_query_var( ‘ap_page’ ) == ‘base’))
{
// Anspress question list page
}
else
{
//Any other Anspress page or non-Anspress page
}
Appreciate the quick reply.
This will let me know if it is on *any* of the AnsPress pages, I’m looking specifically for a way to identify the main base page, not any of the other pages (Ask, Question, Answer, Profile, etc)