• I have this code to call up the latest comments.

    I’d like to truncate the title in these comments.
    How can I get this to work?


    <?php
    global $comment;

    if ( $comments = $wpdb->get_results("SELECT comment_author, comment_ID, comment_post_ID FROM $wpdb->comments WHERE comment_approved='1' ORDER BY comment_date_gmt
    DESC LIMIT 15") ) :
    ?>

    <?php _e(''); ?>
    <?php
    foreach ($comments as $comment) {
    echo '<img class="imgpoll" src="https://frontpage.klifix.nl/forumfiles/pijl_trans.gif"/>' . sprintf('%s :: %s', get_comment_author_link(), 'comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . get_the_title($comment->comment_post_ID) . '
    ');
    echo '';
    }

    ?>

    <?php endif; ?>

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Truncate title in comments’ is closed to new replies.