Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function comment_support_for_my_custom_post_type() {
- add_post_type_support( 'my_post_type', 'comments' );
- }
- add_action( 'init', 'comment_support_for_my_custom_post_type' );
- function collectiveray_enable_threaded_comments(){
- // if (!is_admin()) {
- if (is_singular() AND comments_open() AND (get_option('thread_comments') == 1))
- wp_enqueue_script('comment-reply');
- }
- // }
- add_action('get_header', 'collectiveray_enable_threaded_comments');
- // Change comment date format
- add_filter( 'get_comment_date', 'custom_comment_date_format' );
- function custom_comment_date_format( $d ) {
- $d = date("m.d.y");
- return $d;
- }
- // Remove word " at" from date format
- // Remove comment time
- /*function remove_comment_time($date, $d, $comment) {
- if ( !is_admin() ) {
- return;
- } else {
- return $date;
- }
- }
- add_filter( 'get_comment_time', 'remove_comment_time', 10, 3);
- */
- /*
- function not_default_comments( $comment, $args, $depth ) {
- global $post;
- $author_id = $post->post_author;
- $GLOBALS['comment'] = $comment;
- ?>
- <li id="li-comment-<?php comment_ID(); ?> comment">
- <article id="comment-body" <?php comment_class('clr'); ?>>
- <div class="comment-author vcard">
- <?php echo get_avatar( $comment, 45 ); ?>
- </div><!-- .comment-author -->
- <div class="comment-details clr">
- <header class="comment-meta">
- <cite class="fn"><?php comment_author_link(); ?></cite>
- <span class="comment-date">
- <?php printf( '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
- esc_url( get_comment_link( $comment->comment_ID ) ),
- get_comment_time( 'c' ),
- sprintf( _x( '%1$s', '1: date', 'twenties' ), get_comment_date() )
- ); ?>
- </span><!-- .comment-date -->
- </header><!-- .comment-meta -->
- <?php if ( '0' == $comment->comment_approved ) : ?>
- <p class="comment-awaiting-moderation"><?php esc_html_e( 'Your comment is awaiting moderation.', 'twenties' ); ?></p>
- <?php endif; ?>
- <div class="comment-content entry clr">
- <?php comment_text(); ?>
- </div><!-- .comment-content -->
- <div class="reply comment-reply-link">
- <?php comment_reply_link( array_merge( $args, array(
- 'reply_text' => esc_html__( 'Reply to this message', 'twenties' ),
- 'depth' => $depth,
- 'max_depth' => $args['max_depth'] )
- ) ); ?>
- </div><!-- .reply -->
- </div><!-- .comment-details -->
- </article><!-- #comment-## -->
- <?php
- }
- */
Add Comment
Please, Sign In to add comment