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

    (@deepakjeswal)

    I meant *but what is ‘comment loop’

    You can read about The_Loop in the Codex. And a similar code should be found in the comments.php file.

    The comments loop is pretty basic. In most comments templates it’ll start like this:

    <?php foreach($comments as $comment) { ?>

    Thread Starter deepakjeswal

    (@deepakjeswal)

    Sigh, this only confused me more! Simply, where do i put both the php and css codes. I m sure there must be a simpler method for someone who is seeing PHP for the first time in life!

    PHP: Example from the plugin page:

    <li class="comment <?php echo (is_wpuser_comment() ? ' commentOfficialUser' : ''); ?>" id="comment-<?php comment_ID() ?>">

    This means whatever your comments is using to define a comment block, make use of the class attribute for it (or add one if it doesn’t have it) and stick in the <?php .. ?> portion echoing out the proper value. Most comment templates will have each comment in an <li> (list) element, hence the example provided.

    CSS: Goes into your stylesheet.

    Thread Starter deepakjeswal

    (@deepakjeswal)

    Really sorry to be so much troublesome. But I still dont get it at all. My bad day I suppose!

    I have now found the loop, and done the following:

    <?php foreach ($comments as $comment) : ?>

    <?php if(is_wpuser_comment() != 0) {echo “Official”;} ?>

    <li class=”comment <?php echo (is_wpuser_comment() ? ‘ commentOfficialUser’ : ”); ?>” id=”comment-&lt?php comment_ID() ?>”>

    IN the Style sheet I have put this up:

    /* Begin Comments*/
    .alt {
    margin: 0;
    padding: 10px;
    }

    .commentlist {
    padding: 0;
    text-align: justify;
    }

    .commentlist li {
    margin: 15px 0 3px;
    padding: 5px 10px 3px;
    list-style: none;
    }

    .commentlist p {
    margin: 10px 5px 10px 0;
    }

    .commentOfficialUser {
    border: 1px solid black;
    background-color: #999999
    }

    BUT – All I get is one small thin grey strip OVER the comment.

    ALL I WANT to do is – have my comments in a solid colored box, so that they are differentiated.

    Would also want the word “Official” to go, as it doesnt gel well, and merges into the comment over it! I removed it from the quotes after ‘echo’, and it seemed to go, but was that the right thing to do?

    As of now its looking like this:https://www.deepakjeswal.com/?p=9#comments

    Once again apologies for being a pain!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Official comment Plugin’ is closed to new replies.