-
AuthorPosts
-
July 15, 2014 at 8:40 pm #69063
Hello there!
Having a little problem with a modification I made.
I’m using the latest version of both WordPress and X theme.
If you go to our blog http://www.storybeasts.com you’ll see I’m having a couple of problems with my theme.1) The Leave a Comment message showing to the right, almost out of the post border. Is there anyway to include this in a more elegant way? It looks odd right now.
2) No comment number is showing up. Strangely, I tried this with all the stacks and just “Leave a Comment” shows up. Is it because I’m using the disqus commenting system? If so, what could I do to make it work? I added a piece of code to the functions.php in my child theme that was suggested in another thread but it doesn’t seem to be doing much.
This is how my functions.php file looks like now:<?php // ============================================================================= // FUNCTIONS.PHP // ----------------------------------------------------------------------------- // Overwrite or add your own custom functions to X in this file. // ============================================================================= function x_icon_entry_meta() { $author = sprintf( '<span><i class="x-icon-pencil"></i> %s</span>', get_the_author() ); $date = sprintf( '<span><time class="entry-date" datetime="%1$s"><i class="x-icon-calendar"></i> %2$s</time></span>', esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); if ( get_post_type() == 'x-portfolio' ) { if ( has_term( '', 'portfolio-category', NULL ) ) { $categories = get_the_terms( get_the_ID(), 'portfolio-category' ); $separator = ', '; $categories_output = ''; foreach ( $categories as $category ) { $categories_output .= '<a href="' . get_term_link( $category->slug, 'portfolio-category' ) . '" title="' . esc_attr( sprintf( __( "View all posts in: “%s”", '__x__' ), $category->name ) ) . '"><i class="x-icon-bookmark"></i> ' . $category->name . '</a>' . $separator; } $categories_list = sprintf( '<span>%s</span>', trim( $categories_output, $separator ) ); } else { $categories_list = ''; } } else { $categories = get_the_category(); $separator = ', '; $categories_output = ''; foreach ( $categories as $category ) { $categories_output .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . esc_attr( sprintf( __( "View all posts in: “%s”", '__x__' ), $category->name ) ) . '"><i class="x-icon-bookmark"></i> ' . $category->name . '</a>' . $separator; } $categories_list = sprintf( '<span>%s</span>', trim( $categories_output, $separator ) ); } if ( comments_open() ) { if ( get_comments_number() == 0 ) { $comments = sprintf( '<span><a href="%1$s" title="%2$s" class="meta-comments"><i class="x-icon-comments"></i> %3$s</a></span>', esc_url( get_comments_link() ), esc_attr( sprintf( __( 'Lesave a comment on: “%s”', '__x__' ), get_the_title() ) ), __( 'Leave a Comment' , '__x__' ) ); } else if ( get_comments_number() == 1 ) { $comments = sprintf( '<span><a href="%1$s" title="%2$s" class="meta-comments"><i class="x-icon-comments"></i> %3$s</a></span>', esc_url( get_comments_link() ), esc_attr( sprintf( __( 'Lesave a comment on: “%s”', '__x__' ), get_the_title() ) ), get_comments_number() . ' ' . __( 'Comment' , '__x__' ) ); } else { $comments = sprintf( '<span><a href="%1$s" title="%2$s" class="meta-comments"><i class="x-icon-comments"></i> %3$s</a></span>', esc_url( get_comments_link() ), esc_attr( sprintf( __( 'View all comments on: “%s”', '__x__' ), get_the_title() ) ), get_comments_number() . ' ' . __( 'Comments' , '__x__' ) ); } } else { $comments = ''; } $post_type = get_post_type(); $post_type_post = $post_type == 'post'; $post_type_portfolio = $post_type == 'x-portfolio'; $no_post_meta = get_theme_mod( 'x_blog_enable_post_meta' ) == 0; $no_portfolio_meta = get_theme_mod( 'x_portfolio_enable_post_meta' ) == 0; if ( $post_type_post && $no_post_meta || $post_type_portfolio && $no_portfolio_meta ) { return; } else { printf( '<p class="p-meta">%1$s%2$s%3$s%4$s</p>', $author, $date, $categories_list, $comments ); } } function excerpt_read_more_link($output) { global $post; if ('x-portfolio'==get_post_type($post)) return $output . '<a href="'. get_permalink($post->ID) . '"> Read More </a>'; else return $output; } add_filter('the_excerpt', 'excerpt_read_more_link'); function x_custom_excerpt_more($more) { global $post; if ('x-portfolio'==get_post_type($post)) return '<a class="moretag" href="'. get_permalink($post->ID) . '"> Read More </a>'; else return $more; } add_filter('excerpt_more', 'x_custom_excerpt_more'); add_filter( 'the_content_more_link', 'x_custom_excerpt_more' );add_filter('get_comments_link','replace_comments_link', 10, 2 ); function replace_comments_link( $comments_link, $post_id ) { return str_replace('#comments', '#disqus_thread', $comments_link); }
Thank you!
July 15, 2014 at 10:23 pm #69096Please ignore number 2. It was because of Disqus. I ditched it anyway and I’m using now Jetpack Comment System, more happy with its simplicity.
Still would appreciate some help with number 1 though.July 16, 2014 at 2:12 pm #69495Hi Claudio,
Can you try adding this in Customizer -> Custom -> CSS and see how it works out for you.
.meta-comments { display: none; } .p-meta .meta-comments { font-size: 13px; line-height: 1; display: block; right: 20px; } i.x-icon-comments { font-size: 18px; }
Cheers
September 1, 2014 at 7:34 am #96144This made my blog look much better. Appreciated
September 1, 2014 at 7:41 am #96151You’re Welcome!
Thank you too for the appreciation.
Have a nice day, Cheers!
-
AuthorPosts