Title: Code snippet logic doesn&#8217;t work properly
Last modified: July 11, 2023

---

# Code snippet logic doesn’t work properly

 *  [amateurcoder](https://wordpress.org/support/users/amateurcoder/)
 * (@amateurcoder)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/code-snippet-logic-doesnt-work-properly/)
 * I used a code snippet to show optin form.
 * Then I used the short code format.
 * In the header when I put the short code, it works fine.
 * But I want to hide the form in some pages.
 * So I added “logic”.
 * I added “hide” in a certain URL.
 * But what happens is: the forms is only shown on that page, but hidden in all 
   pages.
   And I get the same result whether I use “hide” or “show”. It only shows
   on that single URL, hides on all pages.I don’t understand what’s wrong with this.
 * It’s Astra Theme, and the code is simple HTML code snippet.
    -  This topic was modified 2 years, 11 months ago by [amateurcoder](https://wordpress.org/support/users/amateurcoder/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcode-snippet-logic-doesnt-work-properly%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/code-snippet-logic-doesnt-work-properly/#post-16894511)
 * Can you provide a screenshot of the snippet?

Viewing 1 replies (of 1 total)

The topic ‘Code snippet logic doesn’t work properly’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/code-snippet-logic-doesnt-work-properly/#post-16894511)
 * Status: not a support question