• Hi all,

    I am brand new to word press and coding but i’ve created the twenty fourteen child theme and have managed to figure out how to change the code to have the blogs appear on the homepage in excerpt format. However, after doing this when you click on the continue reading button it provides it takes you to the blog page but the text only goes up to the continue reading part and the rest of the text is not there. Can someone walk me through what to do next?

    http://www.cflblindspots.com

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello @dmabs,
    Just checked in you site and found that when i click on ‘continue reading’ of the post “CAUSE FOR CONCERN AS STAMPEDERS ROUND OUT 2016 COACHING STAFF” it shows all the text including the part above the continue-reading which is fine. Please verify and let me know if your problem still exists.

    Thanks!

    Thread Starter dmabs

    (@dmabs)

    Hi @WENSolutions,

    You are correct that the continue reading now works. However, that is a change to the post not a solution to the problem. I simply added the read more button from the post edit area. What I would like to do is to be able to have the posts formatted in excerpt (and image) format which those posts are not (they are in standard format). Can someone show me how to code it so I can add the excerpt format to my Twenty Fourteen Child Theme as the option is not there. When in excerpt format I’d like to be able to click on the continue reading button to take you to the whole story. In image format, I’d like for the title to be on the image and you click on the image to take you to the story.

    Thank you!!!

    Hello @dmabs,
    You can paste this code in your functions.php but for bringing this code into effect, you have to use the_excerpt() function in your blog posts page.

    function new_excerpt_more( $more ) {
    	return ' <a class="read-more" href="' . get_permalink( get_the_ID() ) . '">' . __( 'Read More', 'theme-slug' ) . '</a>';
    }
    add_filter( 'excerpt_more', 'new_excerpt_more' );

    Try this and let me know if it worked.
    Thanks!

    Thread Starter dmabs

    (@dmabs)

    Hello @wen Solutions

    Thank you for your reply. I’ve uploaded the code you provided. But I still do not see an option when creating a new post to format it as an excerpt. Do you know why this is?

    Can you explain how I am to use “the_excerpt() function in your blog posts page.”

    Hello @dmabs,
    Normally index.php is used as blog-post page where ‘content.php’ is looped. For reference:

    <?php while ( have_posts() ) : the_post();
                         get_template_part( 'template-parts/content', get_post_format() );
    ?>

    Now, if similar is your case then, go to ‘content.php’ in your theme and use the_excerpt(); instead of the_content();. After that put the below codes in your functions.php along with the code that i gave you in above thread:

    function custom_excerpt_length( $length ) {
    	return 20; //readmore will appear after 20 words
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

    Try this and see if it worked. It is working for me.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Twenty Fourteen Child Theme Excerpt Format Blogs’ is closed to new replies.