Viewing 15 replies - 1 through 15 (of 18 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    I looked at your comments, and they don’t appear to actually have any formatting, they’re just plain text. Needless to say, that’s very odd. It’s like your comments aren’t going through the auto-formatting thingy. Do you have the default-filters.php file in the wp-includes directory?

    Thread Starter carl_in_florida

    (@carl_in_florida)

    otto – I have never heard of that file but I checked and it is there.

    When I look at the comments in the backend the formatting is there. But when it goes to post all formatting is completely stripped.

    I have no idea why.

    Any help is much appreciated.

    I see paragraphs using FireFox, not one big paragraph, just normal ones.

    That’s weird – I am also using Firefox, and I see one big block of text with no line breaks. When I “view source”, I see there are no or
    tags on each new line – which causes the run-on.

    Can you post your comments.php code? Maybe there’s something there that accidentally got deleted or something.

    Thread Starter carl_in_florida

    (@carl_in_florida)

    WOOHOO! somebody is going to help me (gets all misty)
    Liverpoollad – make sure you are looking at the comments, not the posts. There is definately nothing there.
    \
    <?php

    // Some default filters
    add_filter(‘bloginfo’,’wp_specialchars’);
    add_filter(‘category_description’, ‘wptexturize’);
    add_filter(‘list_cats’, ‘wptexturize’);
    add_filter(‘comment_author’, ‘wptexturize’);
    add_filter(‘comment_text’, ‘wptexturize’);
    add_filter(‘single_post_title’, ‘wptexturize’);
    add_filter(‘the_title’, ‘wptexturize’);
    add_filter(‘the_content’, ‘wptexturize’);
    add_filter(‘the_excerpt’, ‘wptexturize’);
    add_filter(‘bloginfo’, ‘wptexturize’);

    // Comments, trackbacks, pingbacks
    add_filter(‘pre_comment_author_name’, ‘strip_tags’);
    add_filter(‘pre_comment_author_name’, ‘trim’);
    add_filter(‘pre_comment_author_name’, ‘wp_specialchars’, 30);

    add_filter(‘pre_comment_author_email’, ‘trim’);
    add_filter(‘pre_comment_author_email’, ‘sanitize_email’);

    add_filter(‘pre_comment_author_url’, ‘strip_tags’);
    add_filter(‘pre_comment_author_url’, ‘trim’);
    add_filter(‘pre_comment_author_url’, ‘clean_url’);

    add_filter(‘pre_comment_content’, ‘stripslashes’, 1);
    add_filter(‘pre_comment_content’, ‘wp_rel_nofollow’, 15);
    add_filter(‘pre_comment_content’, ‘balanceTags’, 30);
    add_filter(‘pre_comment_content’, ‘addslashes’, 50);

    add_filter(‘pre_comment_author_name’, ‘wp_filter_kses’);
    add_filter(‘pre_comment_author_email’, ‘wp_filter_kses’);
    add_filter(‘pre_comment_author_url’, ‘wp_filter_kses’);

    // Default filters for these functions
    add_filter(‘comment_author’, ‘wptexturize’);
    add_filter(‘comment_author’, ‘convert_chars’);
    add_filter(‘comment_author’, ‘wp_specialchars’);

    add_filter(‘comment_email’, ‘antispambot’);

    add_filter(‘comment_url’, ‘clean_url’);

    add_filter(‘comment_text’, ‘convert_chars’);
    add_filter(‘comment_text’, ‘make_clickable’);
    add_filter(‘comment_text’, ‘wpautop’, 30);
    add_filter(‘comment_text’, ‘convert_smilies’, 20);

    add_filter(‘comment_excerpt’, ‘convert_chars’);

    // Places to balance tags on input
    add_filter(‘content_save_pre’, ‘balanceTags’, 50);
    add_filter(‘excerpt_save_pre’, ‘balanceTags’, 50);
    add_filter(‘comment_save_pre’, ‘balanceTags’, 50);

    // Misc. title, content, and excerpt filters
    add_filter(‘the_title’, ‘convert_chars’);
    add_filter(‘the_title’, ‘trim’);

    add_filter(‘the_content’, ‘convert_smilies’);
    add_filter(‘the_content’, ‘convert_chars’);
    add_filter(‘the_content’, ‘wpautop’);

    add_filter(‘the_excerpt’, ‘convert_smilies’);
    add_filter(‘the_excerpt’, ‘convert_chars’);
    add_filter(‘the_excerpt’, ‘wpautop’);
    add_filter(‘get_the_excerpt’, ‘wp_trim_excerpt’);

    add_filter(‘sanitize_title’, ‘sanitize_title_with_dashes’);

    // RSS filters
    add_filter(‘the_title_rss’, ‘strip_tags’);
    add_filter(‘the_title_rss’, ‘ent2ncr’, 8);
    add_filter(‘the_content_rss’, ‘ent2ncr’, 8);
    add_filter(‘the_excerpt_rss’, ‘convert_chars’);
    add_filter(‘the_excerpt_rss’, ‘ent2ncr’, 8);
    add_filter(‘comment_author_rss’, ‘ent2ncr’, 8);
    add_filter(‘comment_text_rss’, ‘htmlspecialchars’);
    add_filter(‘comment_text_rss’, ‘ent2ncr’, 8);
    add_filter(‘bloginfo_rss’, ‘ent2ncr’, 8);
    add_filter(‘the_author’, ‘ent2ncr’, 8);

    // Actions
    add_action(‘publish_post’, ‘generic_ping’);
    add_action(‘wp_head’, ‘rsd_link’);

    ?>
    \

    That’s your comments.php file? Is it the whole thing? Wow. That’s a lot of filters!

    However, I don’t see any actual *formatting* – only filters. You’ve got to at least have this line in your comments.php file:

    <?php comment_text() ?>

    That’s where the formatting is.

    I understand the need for filters – but cripes – why so many? And where’d your formatting go?

    Thread Starter carl_in_florida

    (@carl_in_florida)

    I don’t know is this make a difference but if I completely strip the above file bare and use the default theme it still does not format the comments.

    Thread Starter carl_in_florida

    (@carl_in_florida)

    sorry, that is default-filters.php

    Thread Starter carl_in_florida

    (@carl_in_florida)

    here is my comments.php but it does not matter what theme I use, it is all the same. And i think the plugins did the filters. I have never touched it.
    \
    <!– comments …………………………… –>
    <div id=”comments”>

    <?php // Do not delete these lines
    if (‘comments.php’ == basename($_SERVER[‘SCRIPT_FILENAME’]))
    die (‘Please do not load this page directly. Thanks!’);

    if (!empty($post->post_password)) { // if there’s a password
    if ($_COOKIE[‘wp-postpass_’ . COOKIEHASH] != $post->post_password) { // and it doesn’t match the cookie
    ?>
    <p class=”nocomments”><?php _e(“This post is password protected. Enter the password to view comments.”); ?>
    <?php
    return;
    }
    }
    $commentalt = ”;
    $commentcount = 1;
    ?>

    <?php if ($comments) : ?>

    <h2><?php comments_number(‘No Comments yet’, ‘1 Comment’, ‘% Comments’ ); if($post->comment_status == “open”) { ?> Add your own<?php } ?></h2>

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

      <li id=”comment-<?php echo $commentcount ?>” class=”<?php comment_type(‘comment’,’trackback’,’pingback’); ?>”>
      <p class=”header<?php echo $commentalt; ?>”><?php echo $commentcount ?>.

      <?php if (function_exists(“gravatar”)) { ?><img src=”<?php gravatar(“R”, 23); ?>” alt=”” class=”gravatar” /><?php } ?>

      <?php if ($comment->comment_type == “comment”) comment_author_link();
      else {
      strlen($comment->comment_author)?$author=substr($comment->comment_author,0,25).”&hellip”:$author=substr($comment->comment_author,0,25);
      echo ‘comment_author_url.'”>’.$author.’‘;

      }
      ?>  |  <?php comment_date(‘F jS, Y’) ?> at <?php comment_time() ?>

    <?php if ($comment->comment_approved == ‘0’) : ?>Your comment is awaiting moderation.<?php endif; ?>
    <?php comment_text() ?>
    <?php edit_comment_link(‘Edit Comment’,'<span class=”editlink”>’,'</span>’); ?>

    <?php
    ($commentalt == ” alt”)?$commentalt=””:$commentalt=” alt”;
    $commentcount++;
    ?>

    <?php endforeach; /* end for each comment */ ?>

    <?php endif; ?>

    <?php if ($post->comment_status == “open”) : ?>

    <h2>Leave a Comment</h2>

    <?php if (get_option(‘comment_registration’) && !$user_ID) : ?>
    You must be /wp-login.php?redirect_to=<?php the_permalink(); ?>”>logged in to post a comment.

    <?php else : ?>

    <form action=”<?php echo get_option(‘siteurl’); ?>/wp-comments-post.php” method=”post” id=”commentform”>
    <fieldset>

    <?php if ($user_ID) : ?>

    <p class=”info”>Logged in as /wp-admin/profile.php”><?php echo $user_identity; ?>. /wp-login.php?action=logout” title=”<?php _e(‘Log out of this account’) ?>”>Logout.

    <?php else : ?>

    <label for=”author”>Name</label> <input type=”text” name=”author” id=”author” value=”<?php echo $comment_author; ?>” tabindex=”1″ /> <?php if ($req) echo “Required“; ?>
    <label for=”email”>Email</label> <input type=”text” name=”email” id=”email” value=”<?php echo $comment_author_email; ?>” tabindex=”2″ /> <?php if ($req) echo “Required, “; ?>hidden
    <label for=”url”>Url</label> <input type=”text” name=”url” id=”url” value=”<?php echo $comment_author_url; ?>” tabindex=”3″ />

    <?php endif; ?>

    <label for=”comment”>Comment</label> <textarea name=”comment” id=”comment” cols=”45″ rows=”10″ tabindex=”4″></textarea>
    <input type=”hidden” name=”comment_post_ID” value=”<?php echo $id; ?>” />
    <input type=”submit” name=”submit” value=”Submit” class=”button” tabindex=”5″ />

    </fieldset>
    <?php do_action(‘comment_form’, $post->ID); ?>
    </form>

    Some HTML allowed:<br/><?php echo allowed_tags(); ?>

    <?php endif; // If registration required and not logged in ?>

    <?php endif; // if you delete this the sky will fall on your head ?>

    <?php if ($post-> comment_status == “open” && $post->ping_status == “open”) { ?>
    “>Trackback this post  |  <?php comments_rss_link(‘Subscribe to the comments via RSS Feed’); ?>
    <?php } elseif ($post-> comment_status == “open”) {?>
    <?php comments_rss_link(‘Subscribe to the comments via RSS Feed’); ?>
    <?php } elseif ($post->ping_status == “open”) {?>
    “>Trackback this post
    <?php } ?>

    </div> <!– /comments –>
    \

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Hmm. It appears that the conversion from text to html is supposed to happen in the comment_text call, but isn’t for some reason. Weird.

    Is the functions-formatting.php file there and does it look okay? Don’t post the whole thing please, just answer the question. Look for “function wpautop” and see if there’s anything unusual there. Yes, it has a lot of weird character stuff in it, but the important thing to find out here is if it’s there at all.

    Thread Starter carl_in_florida

    (@carl_in_florida)

    Thanks for your help.

    I found the culprit.
    The ESV plugin https://www.musterion.net/?page_id=196. when I disable it, all is fine. Now to find a fix …

    >>sorry, that is default-filters.php<<

    LOL! I was wondering!

    Hmm…that’s really odd.

    Try this. Find this line in your filters list:

    add_filter(‘comment_text’, ‘wpautop’, 30);

    and change it to this:

    //add_filter(‘comment_text’, ‘wpautop’, 30);

    see what happens? Maybe that will work? (this is such a weird problem!)

    oops…posted after you did – glad you figured it out!

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    OH! I see the problem. It’s in the ESV plugin all right.

    Towards the bottom of esv.php, on line 614, in the function esv_display(), there is a line that says “echo $content;”.

    That should be “return $content;” instead. Echoing the content at that point, before the remaining filters have applied, causes the bad display. If it returned it instead, then other filters would be able to take effect. Mainly, the wpautop filter would be able to run and convert it to html properly.

    Alternatively, you can change this line at the bottom:
    add_filter('comment_text', 'esv_display', 20);
    to this:
    add_filter('comment_text', 'esv_display', 40);

    That will change the priorities and make wpautop run before this filter does.

    Actually, you probably want to do both of these changes. That way, the esv_display filter will be operating on html instead of text.

    Thread Starter carl_in_florida

    (@carl_in_florida)

    otto – is this your plugin?

    I was just going to wait till they updated the plugin but since you went through this much effort I have to give this a try.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Comments display as one big paragraph::WHY?’ is closed to new replies.