Title: Adding java before first post?
Last modified: August 19, 2016

---

# Adding java before first post?

 *  Resolved [k4lic0](https://wordpress.org/support/users/k4lic0/)
 * (@k4lic0)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/adding-java-before-first-post/)
 * Hello everyone. I was wondering how to put a little java script code _before_
   the first post on my wordpress blog..?

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

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [17 years, 4 months ago](https://wordpress.org/support/topic/adding-java-before-first-post/#post-922772)
 * Edit your theme, put the code in there.
 *  Thread Starter [k4lic0](https://wordpress.org/support/users/k4lic0/)
 * (@k4lic0)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/adding-java-before-first-post/#post-922877)
 * Well, **obviously**. But where do I put the code to have it sit before the first
   post?
 * I tried putting it in the first post and making it sticky, but the Java aspects
   didn’t show up within the post. Anyone have a halfway decent answer?
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [17 years, 4 months ago](https://wordpress.org/support/topic/adding-java-before-first-post/#post-922906)
 * I don’t understand the question. You’d put it in your theme wherever the heck
   you’d want it to actually be.
 * I mean, where do you want to put it? In the header? In the footer? In the index
   template? You’re asking the question “where do I put it” but not telling us where
   you actually want to put it, you know? 🙂
 * If you want it before the first post then you edit the theme and put it above
   the posts [Loop](http://codex.wordpress.org/The_Loop). So either there’s your
   answer or I’m somehow misunderstanding your question.
 *  Thread Starter [k4lic0](https://wordpress.org/support/users/k4lic0/)
 * (@k4lic0)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/adding-java-before-first-post/#post-922927)
 * Ahh, it worked that time. Thanks!
 * One last question, the bottom of my java applet is touching the top of the most
   recent blog post. How do I add a gap in between the two page objects?
 *  Thread Starter [k4lic0](https://wordpress.org/support/users/k4lic0/)
 * (@k4lic0)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/adding-java-before-first-post/#post-922938)
 * Anybody know?
 *  [wealthmaker2008](https://wordpress.org/support/users/wealthmaker2008/)
 * (@wealthmaker2008)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/adding-java-before-first-post/#post-922939)
 * Java? is that a plugin??
 *  Thread Starter [k4lic0](https://wordpress.org/support/users/k4lic0/)
 * (@k4lic0)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/adding-java-before-first-post/#post-922943)
 * No, it is a programming language. I’ve got the java that I wanted working. But,
   it’s butted up against the first post.. and I want a gap in between the two items(
   like the gap between the items in the sidebar.)
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [17 years, 3 months ago](https://wordpress.org/support/topic/adding-java-before-first-post/#post-922983)
 * 1. Java is not Javascript. These are two different things entirely, so it’s confusing
   when you mix the two up.
 * 2. Wrap the code in a DIV with a class, and then use CSS to give that DIV some
   extra bottom margin.
 *     ```
       <div class="myscript">
       .. your script ..
       </div>
       ```
   
 * In the CSS file:
 *     ```
       div.myscript {
       margin-bottom: 5px;
       }
       ```
   
 *  [GJtje](https://wordpress.org/support/users/gjtje/)
 * (@gjtje)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/adding-java-before-first-post/#post-923177)
 * Why wrapping another div (tag) around a script tag? The script tag itself is 
   also stylable using CSS. 😉

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

The topic ‘Adding java before first post?’ is closed to new replies.

## Tags

 * [java](https://wordpress.org/support/topic-tag/java/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 4 participants
 * Last reply from: [GJtje](https://wordpress.org/support/users/gjtje/)
 * Last activity: [17 years, 3 months ago](https://wordpress.org/support/topic/adding-java-before-first-post/#post-923177)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
