• Hi, I’ve created a Child Theme that has a style sheet and a functions.php file in it, as per the wordpress advice on setting up a child theme.

    What I’d like to do is add one or the other of the below snippets of code to my child theme, which I’ve copied from on here.

    Do I have to create a new folder called contents.php in my child theme and copy all the info. across to it, and then manipulate the code at that point?

    Many, many, thanks in advance, Stuart!

    <?php if ( is_search() || is_archive() || is_author() || is_tag() || is_home() ) : // Only display Excerpts ?>

    Actually, I found the issue. Change a single line:
    <?php if ( is_search() ) : // Only display Excerpts for Search ?>
    to:
    <?php if ( is_search() || is_home() ) : // Only display Excerpts for Search and Index ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter sbgolledge

    (@sbgolledge)

    Anyone at all?
    I’d be extremely grateful!

    Thread Starter sbgolledge

    (@sbgolledge)

    Gosh, I’d really like some help?

    I’ve added this
    <?php if ( is_search() || is_archive() || is_author() || is_tag() || is_home() ) : // Only display Excerpts ?>

    to my functions.php file (child) and got a parse error!
    I basically just tabbed down a couple of spaces and copied it in!

    I’ve taken it out, now, but really want to have excerpt showing on my ‘recently added,’ ‘archives,’ and ‘categories’ sections. I have a fixed front page on my theme Twenty-Twelve.

    Thread Starter sbgolledge

    (@sbgolledge)

    Do I need to copy the entire content.php file across to my child theme and manipulate the relevant line there?

    Can I add it to my function.php file, or should I create a new folder titled content.php?

    Please, anyone?

    Best,
    Stuart

    Thread Starter sbgolledge

    (@sbgolledge)

    OK, look, I went ahead and created a content.php file in my child theme, then copied the parent theme content.php information into it, after making the changes in this line…

    <?php if ( is_search() || is_archive() || is_author() || is_tag() || is_home() ) : // Only display Excerpts ?>

    it’s worked perfectly, but I’d really like to know whether doing it this way will cause any issues in the future?

    Many thanks,
    Stuart

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Create Excerpts in Twenty Twelve Theme’ is closed to new replies.