I am trying to do some edits to my parent theme. I have made a child theme so that updating the parent wont cause a problem.Now I want to add a certain function that is in the parent theme's functions.php to the functions.php file of the child theme. I am using Oblique theme. Here is the function from the parent file :
function oblique_post_link_to_single() {
if ( ! get_theme_mod( 'read_more' ) ) :?>
<a href="<?php the_permalink(); ?>">
<div class="read-more">
<?php echo apply_filters(
'oblique_post_read_more'
, esc_html__( 'Continue Reading …','oblique' )
);?>
</div>
</a>
<?php
endif;
}
add_action( 'oblique_link_to_single','oblique_post_link_to_single' );
I tried pasting the code into the child theme but doing so gave me an http 500 error and crashed my website. I need to make some changes in this function inside the child theme and make sure this over rides the parent function.