Support » Themes and Templates » Help with PHP

  • Resolved junipingla

    (@junipingla)


    In my comment template I have this code:

    <?php foreach ($comments as $comment) : ?>
    <?php
    $isByAuthor = false;
    if($comment->comment_author_email == 'xxxx@xxxxxx.xxx') {
    $isByAuthor = true;
    }
    ?>
    
    <li class="<?php echo $oddcomment; ?> <?php if($isByAuthor ) { echo 'authorcomment';} ?>" id="comment-<?php comment_ID() ?>">
    
    <cite><?php comment_author_link() ?></cite> skriver:
    			<?php if ($comment->comment_approved == '0') : ?>
    			<em>Your comment is awaiting moderation.</em>
    			<?php endif; ?>

    It make my own comments stand out. Now I would like to change this part “skriver:”
    When it’s my own admin comments I would like it to display “svarar:” instead. Any kind soul who can help me with the code?

    Thanks! :))

Viewing 5 replies - 1 through 5 (of 5 total)
  • whooami

    (@whooami)

    Member

    change this:

    </cite> skriver:

    junipingla

    (@junipingla)

    Whoooami: But I need a php snippet to use, it should be skriver: for all regular comments but svarar: when it’s one of my own.

    whooami

    (@whooami)

    Member

    i dont understand what you are asking.

    XXxxxxXX

    Nevermind, I get it .. skriver is comment in whatever language or something..

    junipingla

    (@junipingla)

    I solved it my self, thanks for your time. I added:
    <?php if($isByAuthor ) { echo 'svarar:'; }else echo 'skriver:'; ?>

    junipingla

    (@junipingla)

    Yes “skriver” means “says” in swedish 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Help with PHP’ is closed to new replies.