Title: Elementor changes get_query_var
Last modified: March 30, 2022

---

# Elementor changes get_query_var

 *  [BackuPs](https://wordpress.org/support/users/backups/)
 * (@backups)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/elementor-changes-get_query_var/)
 * calling $post_type_name = get_query_var( ‘post_type’ ); when elementor is active
   returns a array even in pages that are not using elementor. This is incorrect!!!
 *     ```xdebug-var-dump
       <small></small>
       			<b>array</b> <i>(size=3)</i>
       			  0 <font color="#888a85">=></font> <small>string</small> <font color="#cc0000">'post'</font> <i>(length=4)</i>
       			  1 <font color="#888a85">=></font> <small>string</small> <font color="#cc0000">'page'</font> <i>(length=4)</i>
       			  2 <font color="#888a85">=></font> <small>string</small> <font color="#cc0000">'e-landing-page'</font> <i>(length=14)</i>
       ```
   
 * array (size=3)
    0 => string ‘post’ (length=4) 1 => string ‘page’ (length=4) 2
   => string ‘e-landing-page’
 * This message shows in pages and posts that have been created or saved after elementor
   was activated. Even if they are not elementor pages.
 * Theme developers are expecting a post_type to be returned not a array !
 * This is incorrect. It should never show that message on not elementor pages. 
   How can i turn off that behavior. I dont want a array returned i need the post
   type returned !

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

 *  Thread Starter [BackuPs](https://wordpress.org/support/users/backups/)
 * (@backups)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/elementor-changes-get_query_var/#post-14217242)
 * in page or post get_query_var( ‘post_type’ ); returns a empty string ! It returns
   the post type name on any cpt ! Elementor is changing that behaviour and returns‘
   e-landing-page’ on a single post or page. To me this is incorrect as those are
   NOT custom posts types !
 * Please adjust this behaviour !
 *  [saidaboukhadra](https://wordpress.org/support/users/saidaboukhadra/)
 * (@saidaboukhadra)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/elementor-changes-get_query_var/#post-14268870)
 * .
 * .”
 *  Thread Starter [BackuPs](https://wordpress.org/support/users/backups/)
 * (@backups)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/elementor-changes-get_query_var/#post-14268912)
 * [@saidaboukhadra](https://wordpress.org/support/users/saidaboukhadra/)
 * This has nothing todo with the pro version. The error code happens when you use
   elementor and call
 *  $test= get_query_var( ‘post_type’ );
    if {$test==’your_post_type’} {}
 * without the pro version activated.
    -  This reply was modified 5 years, 2 months ago by [BackuPs](https://wordpress.org/support/users/backups/).
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [4 years, 2 months ago](https://wordpress.org/support/topic/elementor-changes-get_query_var/#post-15510986)
 * > without the pro version activated.
 * [@backups](https://wordpress.org/support/users/backups/) As you are an Elementor
   Pro user the developer can’t have a conversation with customers here. That’s 
   not permitted for anyone.
 * Do not seek Elementor support in the community forums.
 * For pro or commercial product support please contact the developer directly on
   their site. This includes any pre-sales topics as well.
 * [https://my.elementor.com/](https://my.elementor.com/)
 * As the developer is aware, commercial products are [not supported in these forums](https://wordpress.org/support/guidelines/#do-not-post-about-commercial-products).
   I am sure they will have no problem supporting you there.

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

The topic ‘Elementor changes get_query_var’ is closed to new replies.

 * ![](https://ps.w.org/elementor/assets/icon-256x256.gif?rev=3444228)
 * [Elementor Website Builder - more than just a page builder](https://wordpress.org/plugins/elementor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/elementor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/elementor/)
 * [Active Topics](https://wordpress.org/support/plugin/elementor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/elementor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/elementor/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/elementor-changes-get_query_var/#post-15510986)
 * Status: not resolved