How to Delete Old Comments by Date?
You could easily do this using mysql: DELETE FROM wp_comments WHERE comment_date < DATE_ADD(CURDATE(), INTERVAL -6 MONTH)
You could easily do this using mysql: DELETE FROM wp_comments WHERE comment_date < DATE_ADD(CURDATE(), INTERVAL -6 MONTH)
FB – Comment Moderation Tool bug or error in the code?
add to your loop and replace it with the the_permalink() function something like this: <?php // Include WordPress define(‘WP_USE_THEMES’, false); require(‘./blog/wp-load.php’); ?> <div> <p style=”font-size:18px;color:white;font-wieght:700;”>Recently Asked Questions</p> <?php query_posts(‘showposts=3’); ?> <?php while (have_posts()): the_post(); ?> <div id=”faq”> <a href=”https://wordpress.stackexchange.com/questions/7919/<?php the_permalink() ?>”><?php the_title() ?></a><br /> <?php the_time(‘F jS, Y’) ?> <?php the_excerpt(); ?> <?php comments_popup_link(); ?> … Read more
The tags that are allowed in comments are stored in the $allowedtags global variable. You can try adding elements to that list (the key is the tag name, the value is an array of allowed attributes). If you have problems with the timing you can play with the CUSTOM_TAGS global variable.
I cannot find that function in source and also not sure about your code nesting there. There is paginate_comments_links() function. Usage is around this: if ( get_option( ‘page_comments’ ) ) paginate_comments_links();
You have to set the value of $_POST[‘comment_post_ID’] to the post id of the page: <input type=”hidden” name=”comment_post_ID” value=”10″ /> Then set the action of the form element to /wp-comments-post.php, filter ‘comment_post_redirect’ and send the visitor back to page where the comment/review was written. Here is an example, written as plugin: <?php /* Plugin Name: … Read more
If you look in wp-includes/default-filters.php you’ll see all of the functions each comment is run through before it’s output. I’d guess it’s the last one, wpautop, which adds p tags in place of line breaks: add_filter( ‘comment_text’, ‘wptexturize’ ); add_filter( ‘comment_text’, ‘convert_chars’ ); add_filter( ‘comment_text’, ‘make_clickable’, 9 ); add_filter( ‘comment_text’, ‘force_balance_tags’, 25 ); add_filter( ‘comment_text’, … Read more
I suggest adding a snippet to the theme file where the comments form is loaded that checks to make sure there is a logged in user and then, if that user a Subscriber, then show the comments form to them. The examples below use the Twenty Sixteen theme: In comments.php: // First, get the current … Read more
You create your own comments_template, it can be a duplicate function of the default one, the only changes are the database queries anyway. But you need your own function as WP doesn’t help you with filters here. SO, name it my_comments_template(): $filter = mysql_real_escape_string($_POST[‘comment-filter’]); if(!empty($filter)) $filter = “AND (comment_content LIKE ‘%%{$filter}%%’ OR comment_author LIKE ‘%%{$filter}%%’)”; … Read more
This is indeed the default behavior of WordPress. The comments always stay on the same comment page, so if you show the last comment page first, that last comment page will not always have the “full” number of comments. The advantage of keeping a comment always on the same comment page is that the URL … Read more