Hello, I would like to show the post excerpt on rentalhive theme for the posts blocks. Like it is on TaskHive for example. Rentalhive only has the date created and author. I would much rather change it for the text like on taskhive. What would be the solution to this? Is there any snippet for this? Thank you
Hi,
Currently, the blog layout is determined by the theme. We recommend to try using third-party plugins to modify it, or hire a developer for custom CSS modifications: Customize your website | HivePress.
Hope this helps
Hello, I would like some general css guidance to this. I could maybe figure this out, but need some direction first. I previously read that you can copy some lines or files from other themes to yours. So, can it be just added through css or by copying some codes in file manager? Just need direction if not solution. Thank you
I figured it out. So for anyone who would like to show description/excerpt for posts in theme where its not shown by default, like in my case rentalhive. I copied the post-archive.php from experthive to rentalhive in templates and edited it to this:
<article <?php post_class( 'post--archive' ); ?>>
<?php if ( has_post_thumbnail() ) : ?>
<header class="post__header">
<div class="post__image">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'ht_landscape_small' ); ?></a>
<?php if ( has_category() ) : ?>
<div class="post__categories">
<?php the_category( ' ' ); ?>
</div>
<?php endif; ?>
<?php get_template_part( 'templates/post/post-date' ); ?>
</div>
</header>
<?php endif; ?>
<div class="post__content">
<?php if ( get_the_title() ) : ?>
<h3 class="post__title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</h3>
<?php endif; ?>
<?php if ( ! get_post_format() && get_the_excerpt() ) : ?>
<div class="post__description">
<?php
$excerpt = get_the_excerpt();
echo wp_kses_post( wp_trim_words( $excerpt, 20, '...' ) );
?>
</div>
<?php endif; ?>
</div>
<footer class="post__footer">
<?php get_template_part( 'templates/post/post-details' ); ?>
<a href="<?php the_permalink(); ?>" class="post__readmore"><i class="fas fa-arrow-right"></i></a>
</footer>
</article>
This shows excerpt under blog posts and limits the excerpt to 20 so it shows the same length for every post even when the actual excerpt set in post is longer. So it keeps the same size for every post.
This solved my problem, so it might help others as well.
Thanks for sharing!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.