• I want to know how to edit the lines of Recent Articles showing up on the front page.

    This is my website: https://www.lindahuang.me/
    The lines of Recent Articles showing up now is 12 lines.
    I want to reduce the numbers to 3 lines.

    Could anyone help me?
    Thank you in advance!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • To change your post content word limits under recent articles follows the steps:

    1. Open page-template-front.php from your themes folder
    2. Search “the_excerpt()” and replace it with “oxygen_excerpt_length()”
    3. Save the file and then check.

    You can also pass word limit as per requirement to oxygen_excerpt_length function as:

    oxygen_excerpt_length(50);

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    You could do that, but when an Oxygen theme update comes around, you’ll lose all of your changes and that would not be fun.

    Try creating a child theme of Oxygen instead. It’s a safer way to handle changes like that.

    1 – Create a new directory wp-content/themes/oxygen-child and put these two file in it.

    The first file is the style.css file:

    /*
    Theme Name: Oxygen Child Theme
    Author: Self-Help WordPress User
    Template: oxygen
    */
    
    @import url("../oxygen/style.css");

    The second file is a functions.php file.

    <?php
    /* My custom excerpt length */
    add_filter( 'excerpt_length', 'mh_excerpt_length' , 20 );
    function mh_excerpt_length( $length ) {
            return 50;
    }

    2 – Now visit your WordPress dashboard and activate the theme “Oxygen Child Theme”. You can start making changes to your child theme and leave your parent theme intact.

    The excerpt length is a filter added after the oxygen_excerpt_length so this setting will override the parent theme setting.

    https://codex.www.ads-software.com/Function_Reference/the_excerpt

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Oxygen Theme questions’ is closed to new replies.