0

I wonder how to hide shortcode in wordpress when javascript is disabled. The shortcode appear like strings so is ti a way to hide them with some codes?

here an exemple in php when i call a shordtcode:

<?php echo do_shortcode('[SHORTCODE HERE]'); ?>

Regards,

1 Answer 1

1

for this issue you can use <noscript> tag. So f.e:

<noscript>
 <p>JS is switched off in a browser</p>
</noscript>
<script type="text/javascript">
...put here js code, which will be executed if js will be enabled...
</script>
Sign up to request clarification or add additional context in comments.

2 Comments

The problem is that i can't put a php tag in script tag.
you can see how you can do that here stackoverflow.com/questions/3241422/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.