How can I modify Astrid theme

Have a great day.
In the simple site of our association (www.quadrantearte.it) I am using your excellent free theme “Astrid”.
I have created a child theme and would like to modify a couple of things:

  1. I personally find the “Read More” button too big: how do I reduce the size? Again: is it possible to reduce the distance between an article and the next one?
  2. In Home, each article shows the creation date and the category: is it possible, for the articles that have comments, to show the number of comments?

See example image:

Thank you very much.

Translated with www.DeepL.com/Translator (free version)

Hi,

I am sorry for the delay in response. I was stuck in draft.

  1. I personally find the “Read More” button too big: how do I reduce the size? Again: is it possible to reduce the distance between an article and the next one?

Try adding this CSS code to Appearance > Customize > Additional CSS from dashboard.

    button, .button, input[type="button"], input[type="reset"], input[type="submit"] {
      padding: 5px 10px;
    }

    .hentry {
      padding-top: 15px;
      padding-bottom: 15px;
    }
  1. In Home, each article shows the creation date and the category: is it possible, for the articles that have comments, to show the number of comments?

Try adding this function to your child theme’s functions.php file.

    function astrid_posted_on() {
    	$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
    	if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
    		$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
    	}

    	$time_string = sprintf( $time_string,
    		esc_attr( get_the_date( 'c' ) ),
    		esc_html( get_the_date() ),
    		esc_attr( get_the_modified_date( 'c' ) ),
    		esc_html( get_the_modified_date() )
    	);

    	$posted_on = '<i class="fa fa-calendar"></i><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>';

    	$byline = sprintf(
    		'<i class="fa fa-user"></i>' . esc_html_x( '%s', 'post author', 'astrid' ),
    		'<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
    	);

    	echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK.

    	$categories_list = get_the_category_list( esc_html__( ', ', 'astrid' ) );
    	if ( $categories_list ) {
    		echo '<span class="cat-links"><i class="fa fa-folder-o"></i>' . $categories_list . '</span>';
    	}

    	if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
    		$comment_count = get_comments_number( get_the_ID() );
    		$comment_label = __('Comment', 'astrid');
    		if( $comment_count > 1 ) {
    			$comment_label = __('Comments', 'astrid');
    		}
    		echo '<span class="comments-link"><i class="fa fa-comment-o"></i> '. $comment_count . ' '. $comment_label . '</span>';
    	}

    }

Adding, in case you’re new to child theming, here is the link to get started with: https://developer.wordpress.org/themes/advanced-topics/child-themes/

Regards,
Kharis
aThemes Support

Thank you very much! Perfect!

I wonder if I can ask one more thing:

Is possible that an article is very short and is shown all in the preview. In such cases the “Read more” button would not make sense and could be omitted.
I realize, however, that in such cases there would be no possibility to comment on the article, so would be too complicated to replace the text of the button from “Read more” to “Comment”?

You’re welcome!

I agree with your idea, that those will surely improve the user experience. But as of now, we don’t think a theme should provide that feature and it is considered as a complex task.

Adding, ideally website’s administrator knows what he is doing in the preview mode. And the full functionalities can be easily accessed on a separate tab of web browser.

I don’t think it will be applicable as the current button has its own purpose. “Comment” link should be a separate think. But, if you want to do so, I’d recommend using translation method. You may want to use the Loco Translate plugin to translate the theme’s strings.

Regards,
Kharis
aThemes Support

1 Like

Thank you anyway.
Avelino De Sabbata.

You’re welcome Avelino!

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis
aThemes Support

Please tell me astrid theme is good for my billing website [link deleted]

Need Reviews.
Thanks

Hi,

Thank you for contacting us.

I can confirm that you can use Astrid for a blog website like the one you mentioned.

Regards,
Kharis
aThemes Support