Numbering only parent comments
You can check if the comment has a parent and only count if not: global $counter; if ($comment->parent == 0){ $counter++; }
You can check if the comment has a parent and only count if not: global $counter; if ($comment->parent == 0){ $counter++; }
This is the official Facebook plugin: http://wordpress.org/extend/plugins/facebook/ supported both by Facebook and Automattic. Give it a spin.
You could use a plugin like SB Welcome Email Editor to edit the welcome message. You can use HTML here, so adding an image is easy. To make sure only invited members can see the site untick the Anyone can register setting on wp-admin/options-general.php and install a plugin like Members to require users to log … Read more
This might not directly answer your question (because I haven’t even thought about why the $_POST[‘submit’] would be ignored or if it is even correct), but you should use filters/actions whenever possible. The correct filter for filtering comment text is pre_comment_content, and you should use it like this: function my_filter_comment_for_swear_words( $comment_content ) { // Verify … Read more
WP_Comment_Query doesn’t pull comment meta. You can search by comment meta but the query doesn’t return that data. You could easily check this yourself by looking at the Codex. You need to loop over the results and run get_comment_meta(), or essentially do the same via a filter on the_comments. It is also possible to add … Read more
You should use get_comments( $args ) and add the post ID in the arguments ($args) array: $post_id = 1; // post ID here from the submitted data $comments = get_comments(array( ‘post_id’ => (int) $post_id )); // dump the comments found print_r( $comments ); That would get you a comments list on that post. Hope that … Read more
First, you should look at creating a child theme. That way, any modifications you make won’t be removed by a WordPress update. Next, edit wp-content/themes/twentyseventeen/template-parts/post/content.php and look for the following code: if ( is_single() ) { the_title( ‘<h1 class=”entry-title”>’, ‘</h1>’ ); } elseif ( is_front_page() && is_home() ) { the_title( ‘<h3 class=”entry-title”><a href=”‘ . esc_url( … Read more
Your comment replies do not work because you’re using a custom comment rendering callback function named better_comments, and this function hardcodes the classes IDs and other attributes rather than calling functions such as comment_ID. I strongly suggest abandoning this function, and instead opting for the default commenting from a default theme. This way you can … Read more
A simple way to arrange your comments by most recent is to add this to your functions.php file: if (!function_exists(‘custom_reverse_comments’)) { function custom_reverse_comments($comments) { return array_reverse($comments); } } add_filter (‘comments_array’, ‘custom_reverse_comments’);
Whether you put custom code in your theme’s functions.php or in a plugin, you’re still using custom code. So I’m going to ignore your “without a plugin” requirement and instead suggest these two plugins: Search Everything Relevanssi There is absolutely no reason to use custom functionality in functions.php rather than a plugin. When you’re asking … Read more