Title: Some WordPress functions are not working
Last modified: November 26, 2024

---

# Some WordPress functions are not working

 *  Resolved [dromelos](https://wordpress.org/support/users/dromelos/)
 * (@dromelos)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/wordpress-function-not-work/)
 * I’m using Snippet Vault with AI Engine and trying to use the following instructions
   in a function:
   `get_post_type()`, `get_the_ID()`, `get_query_var('my_par')`.None
   of these return the expected value, while `get_current_user_id()` works.Where
   am I going wrong?

Viewing 1 replies (of 1 total)

 *  Plugin Support [Val Meow](https://wordpress.org/support/users/valwa/)
 * (@valwa)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/wordpress-function-not-work/#post-18171489)
 * Hey [@dromelos](https://wordpress.org/support/users/dromelos/)! 👋
 * These functions (without parameters) retrieve the ID of the current item in the
   WordPress Loop. However, if you’re calling a snippet of code that is executed
   outside of this loop, the value cannot be fetched this way. Hope this helps!

Viewing 1 replies (of 1 total)

The topic ‘Some WordPress functions are not working’ is closed to new replies.

 * ![](https://ps.w.org/ai-engine/assets/icon-256x256.png?rev=3431928)
 * [AI Engine - The Chatbot, AI Framework & MCP for WordPress](https://wordpress.org/plugins/ai-engine/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ai-engine/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ai-engine/)
 * [Active Topics](https://wordpress.org/support/plugin/ai-engine/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ai-engine/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ai-engine/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Val Meow](https://wordpress.org/support/users/valwa/)
 * Last activity: [1 year, 6 months ago](https://wordpress.org/support/topic/wordpress-function-not-work/#post-18171489)
 * Status: resolved