abdo refky abdo refky - 2 months ago 8
CSS Question

wordpress blog homepage customization

please don't give a negative feed like always and instead tell me the mistake.

I have a blog.

can i make the homepage display a summary of an article instead of the whole article?

if yes then where or how can i do it?

Answer

I have this pre-set in one of my WordPress sites. Here is what this looks like and it is in Appearance/Editor/Posts Page (home.php)

    <div class="post-content">
        <?php $content = get_the_content(); ?>
        <?php echo wp_trim_words(strip_tags($content), 30); ?>
    </div>

<a class="blog-post-read-more" href="<?php echo esc_url( get_the_permalink( get_the_ID() ) ); ?>"><?php echo esc_html( get_theme_mod( 'relia_blog_read_more', __( 'Read More', 'relia' ) ) ); ?></a>

   </div>

So what this does is it will strip the words up to 30, wp_trim_words. And below that is the how to insert Read More.

Here are some links for you to check out: https://codex.wordpress.org/Excerpt https://codex.wordpress.org/Customizing_the_Read_More