@fankybee Which is the function that you want to edit. If it is this function attitude_theloop_for_page. Then just copy this function in the functions.php file of your child theme and make the necessary changes there.
function attitude_theloop_for_page() {
// Copy all the inside code and make you changes here.
}