WordPress.org

Ready to get started?Download WordPress

Forums

Moving the comments link (9 posts)

  1. SystemOfAJon
    Member
    Posted 9 years ago #

    I'm tweaking the Gespaa theme a bit right now, and I'm trying to move the "No Comments" link from below the post to right beside the date (the date, not the title).

    The problem is, when I put the code right after the date is called (or whatever the technical term is), there is a line break between the date and the comments link. How can I get rid of this?

  2. Jinsan
    Member
    Posted 9 years ago #

    i'd need a visual clue as to what you mean

  3. SystemOfAJon
    Member
    Posted 9 years ago #

    Arggghhh....Somehow the PrtScn key isn't working on this new keyboard. Sorry! Let me try to explain it better. I'm trying to do, for all practical purposes, what Michael has done at Binary Bonsai. Instead of the comment number and link to the comments being beside the title, though, I want it beside the date. For my purpose, I don't want any titles.

    I took the code for the comments and put it right below the the_date code. The result:

    <?php
    the_date('','<h2 class="entrydate">','</h2>');
    ?>

    <?php
    $comments_img_link = '<img src="' . get_stylesheet_directory_uri() . '/images/comments.gif" title="comments" alt="*" />';
    comments_popup_link('No Comments', $comments_img_link . ' 1 Comment', $comments_img_link . ' % Comments');
    ?>

    The thing is, the result has a line break in it. Thus:

    "May 1 2005
    No Comments"

    Intsead of it being "May 1 2005 No Comments".

    There's nothing obvious to me that needs to be corrected, such as a <p> or <br>, so I am at a complete loss. That's why I've come here. :D

  4. donkey
    Member
    Posted 9 years ago #

    The <h2></h2> tags work like tags. It automatically adds a line break after it. Perhaps there is a way to cancel this out with css, but I'm not sure.

  5. donkey
    Member
    Posted 9 years ago #

    Oops, my paragraph tags didn't show up. That sentence should have been "h2 tags work like p tags".

  6. SystemOfAJon
    Member
    Posted 9 years ago #

    Aaaah...that sounds like that is the culprit to me. Is anyone aware of a way to cancel that with CSS, or another way to keep the date text size the same without using the h2 tags?

  7. Root
    Member
    Posted 9 years ago #

    Yes. The h2 is a block level element. I might try display: inline in the CSS. But I fear you may need to float it or something.

  8. SystemOfAJon
    Member
    Posted 9 years ago #

    The display: inline did the trick beautifully. Thanks a ton, Root! :D

  9. Root
    Member
    Posted 9 years ago #

    No problem.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags