Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I added a button and when you press on it new content should come up on top of everything, but if I icnlude my code into header.php it will cover only header, if I include in index.php it will cover only index, so my question is where I should include my code?

share|improve this question
add comment

2 Answers

I guess what you need is wp_register_script() + wp_enqueue_script()

Are you talking about PHP or JavaScript??? Your description is simply not sufficient.

share|improve this answer
add comment

If you want to echo something extremely early, you can do that at template_redirect hook that runs before any template is processed. However that will effectively put output outside of proper markup and so markup produced will be invalid.

I do not quite understand why you need to actualyl output it early, if presentation is controlled with JavaScript (I assume?). You could as well echo it at end of page hidden and position/show when and how is needed on button pressed.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.