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