• Resolved xanarchistx

    (@xanarchistx)


    Whenever a user posts a comment on my site, there is always a number that lists the placement of the post, and is located on the left of the comment post. I am trying to figure out which part of the code does this within comments.php, but I cannot find it. Any idea?

Viewing 8 replies - 1 through 8 (of 8 total)
  • I took a look at the code and it wasn’t apparent to me either though I saw several possible culprits. I’d recommend what I always do when I want to customize the code… just make a copy of the current comments.php so you can royally skrew it up without permanent loss, then anything that vaguely looks like it might be responsible for putting numbers in there, change or delete it and see what effect it has. Great way to both accomplish your task while learning more about WordPress, and PHP.

    Any idea?

    I took a look at the code and it wasn’t apparent to me either though I saw several possible culprits.

    awww c’mon..

    the comments are lists, specifically ordered lists. ordered lists are done like so:

    <ol>
    <li> thing </li>
    <li> thing </li>
    <li> thing </li>
    </ol>

    ordered lists, just like the name suggests are ordered aka numbered. if you dont want the numbers change the <ol></ol> tags <ul></ul> tags or remove the ols and lis completely.

    oh my god that was so obvious as to be embarassing. here i’m looking for the PHP function that does this, and it’s HTML 101. yikes!

    and i’m not even the one that needed the answer in the first place!

    (bored on my lunch break i guess)

    Thread Starter xanarchistx

    (@xanarchistx)

    Problem with that. The way I have it set up is this:

    <ol class="comments_list">
         <?php foreach ($comments as $comment) : ?>
    	<?php echo get_avatar(); ?>
    		<li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
    
    	        </li>
    	<?php
    		$oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
    						?>
         <?php endforeach; /* end for each comment */ ?>
     </ol>

    What exactly do I alter to get rid of numbers? One issue I have is that if I get rid of any of this code, it either converts to bullets, or screws up the format.

    What exactly do I alter to get rid of numbers?

    I told you what to do, already. the ol tags and li tags are clearly visible in what you pasted.

    Bullets are what you get when you change ols to uls. You want to change that then you edit your style.css

    How to style an unordered list:

    https://www.google.com/search?hl=en&safe=off&pwst=1&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=how+to+style+unordered+lists&spell=1

    And, just so you are clear, that “format” you write of, thats a consequence of your stylesheet. If you change something, you will need to adjust your css accordingly to compensate for the changes.

    Thread Starter xanarchistx

    (@xanarchistx)

    Ahh, all I had to do was just add ‘list-style-type:none;’ under the li in the stylesheet, and that’s it!

    Now the numbers are gone. Didn’t have to change or remove any of the ol or li tags.

    Thanks anyways!

    Thanks anyways!

    uh, yeah whatever. not like you didnt follow the link to google, Im sure.

    Thread Starter xanarchistx

    (@xanarchistx)

    Actually, I didn’t notice that you added the link to your post until I came back to the forums. You must have edited it, cause the first time around it wasn’t there.

    But thanks for trying anyways!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Get rid of numbers next to comment posts’ is closed to new replies.