Forums

[resolved] Adding java before first post? (10 posts)

  1. K4Lic0
    Member
    Posted 3 years ago #

    Hello everyone. I was wondering how to put a little java script code before the first post on my wordpress blog..?

  2. Otto
    Tech Ninja
    Posted 3 years ago #

    Edit your theme, put the code in there.

  3. K4Lic0
    Member
    Posted 3 years ago #

    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?

  4. Otto
    Tech Ninja
    Posted 3 years ago #

    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. So either there's your answer or I'm somehow misunderstanding your question.

  5. K4Lic0
    Member
    Posted 3 years ago #

    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?

  6. K4Lic0
    Member
    Posted 3 years ago #

    Anybody know?

  7. wealthmaker2008
    Member
    Posted 3 years ago #

    Java? is that a plugin??

  8. K4Lic0
    Member
    Posted 3 years ago #

    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.)

  9. Otto
    Tech Ninja
    Posted 3 years ago #

    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;
    }
  10. GJtje
    Member
    Posted 3 years ago #

    Why wrapping another div (tag) around a script tag? The script tag itself is also stylable using CSS. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags