0

Help a non-coder out! I tried using child theme configurator, and have successful created a theme child, but it doesn't appear to contain the same code as the parent theme. And all the answers to a similar question I find on the web have a code which I can not find on my version of the theme. This could be due to the fact that they were asked years ago, and the code might be different in the version I have but I am not sure.

Would appreciate help!

enter image description here enter image description here

2
  • 1
    Please edit your question to paste in the actual code snippets instead of screenshots of the code.
    – Pat J
    Jun 10, 2022 at 20:00
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Jun 21, 2022 at 16:15

1 Answer 1

0

You can do this with just a couple of files, no need for a plugin.

On your computer...

  1. Create a folder twentyseventeen-excerpt
  2. Add the file style.css:
/**
 * Theme Name:  Twenty Seventeen Excerpt
 * Template:    twentyseventeen
 * Version:     1.0
 * Theme URI:   https://wordpress.stackexchange.com/q/406641/1685
 * Author:      the WordPress team
 * Author URI:  https://wordpress.org/
 * Description: Twenty Seventeen with excerpts.
 */

/* Load the core Twenty Seventeen styles */
@import '../twentyseventeen/style.css';
  1. Add the file template-parts/post/content.php:
<?php

if ( is_singular() ) {
    // Load the default version of this file from Twenty Seventeen
    include TEMPLATEPATH . '/template-parts/post/content.php';
} else {
    // For archive pages (i.e. not singular post pages) load the excerpt content instead
    get_template_part( 'template-parts/post/content-excerpt' );
}
  1. ZIP the twentyseventeen-excerpt folder and upload it using Appearances > Themes > Add New > Upload Theme
  2. Activate the newly uploaded theme "Twenty Seventeen Excerpt"

For ease-of-use I have created the final ZIP that you can download in case you are unable to do the above steps yourself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.