Allow comments only for custom post type

if you are using the code from the thread you linked to, to disable the comments on post and pages then when a new post/page is added it should have the comments automatically disabled. The existing posts/pages will have comments enabled unless you uncheck the “Allow comments” checkbox when editing a post. A quick and … Read more

How to edit the default comment title?

You can probably try somthing like this – untested… add_filter(‘comment_form_defaults’, ‘wpse379939_comment_form_modification’); function wpse379939_comment_form_modification($defaults){ // check if we have 2 or more comments.. if ( get_comments_number() >= 2) { $defaults[‘title_reply’] = __(‘Add Your Voice To The Topic!’); } return $defaults; }

Random output of comments using a shortcode

Easy thing would be to override comment query and set orderby property to rand. function wpse381090_comment_query_rand( $args ) { $args[‘orderby’] = ‘rand’; return $args; } add_filter(‘comments_template_query_args’, ‘wpse381090_comment_query_rand’);

Display the list of user’s comments + the post title + date

add this snippet for according your needed: add_shortcode ( ‘show_recent_comments’, ‘show_recent_comments_handler’ ); function show_recent_comments_handler( $atts, $content = null ) { extract( shortcode_atts( array( “count” => 10, “pretty_permalink” => 0 ), $atts )); $output=””; // this holds the output if ( is_user_logged_in() ) { global $current_user; get_currentuserinfo(); $args = array( ‘user_id’ => $current_user->ID, ‘number’ => $count, … Read more

How to pass parameters in wordpress shortcode?

As the docs for add_shortcode() state, Every shortcode callback is passed three parameters by default, including an array of attributes ($atts), the shortcode content or null if not set ($content), and finally the shortcode tag itself ($shortcode_tag), in that order. Use the shortcode_atts() to define what attributes are allowed and set default values for those … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)