Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Kai2810

    (@kai2810)

    BTW, if you need the style.css file, it’s at

    https://css.internetmarketing4noobs.com

    Thanks in advance!

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Why don’t you move all that gravatar code lower? As in, where you actually want it to be? You have it appearing before the DIV now, so, naturally, it will appear above the DIV.

    Here’s what you do. You take lines 8-21, wrap them in a <?php …?> bit, and then place that where you actually want it.

    Standard PHP rules. If you want to use PHP code, it has to be inside <?php … ?> tags. But you can put those anywhere you like.

    Thread Starter Kai2810

    (@kai2810)

    Tried that…it messed up the whole arrangement…

    I swapped the positions of the
    <div class=”entry”>…</div> and
    <div class=”postinfo”>…</div> bunch of codes, and then cut and pasted lines 7 to 22 to be under the
    <div class=”postinfo”>, as I want the photos to be above the comment author info.

    That did not work. Any suggestions?

    Do these PHP stuff follow a sequence?

    Thread Starter Kai2810

    (@kai2810)

    Help…anyone?

    Just to make sure I’m clear, I am trying to position the gravatar above the comment author info, and then the main body of the comment sitting to the right of the gravatar.

    https://www.internetmarketing4noobs.com/2007/01/27/articlemarketercom-approved-my-articlewithout-me-changing-much/#comments

    As you can see, there’s a big empty space next to the gravatar…

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Kai2810: I guess you didn’t understand what I was telling you. What I suggested above does, in fact, work. It just seems like you don’t understand the basic way to make PHP code work.

    PHP code is not all that different from HTML. You have a webpage. You want to stick PHP code in it. The <?php and ?> tags set that PHP code apart from the HTML.

    You don’t need to “swap positions of entry and postinfo”. That doesn’t even make sense as I see it.

    Take the example at your link: https://paste.uni.cc/12881
    Cut out lines 7 through 21.
    Paste them in another empty document.
    Add “<?php” to the top.
    Add “?>” to the bottom.
    Cut the entire thing back out.
    Paste it in your document right after the div class=archive.

    That will work. It may not give you the exact layout you want, but the page will at least work and the gravatar will be part of the post instead of above it and outside it. Layout is then your own problem.

    And go get a book on PHP before trying to do things in it without understanding it. You might also want to learn XHTML and CSS while you’re at it.

    Thread Starter Kai2810

    (@kai2810)

    Thanks Otto!

    That worked well!

    Sorry if I did not understand what you were saying at first…turned out to be so simple…

    Thanks again!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Help using <?php foreach ($comments as $comment) : ?> and <DIV> tag’ is closed to new replies.