override functions.php in child theme: where am I wrong?!?
-
I need to modify the functions.php on my father theme in order to change “Continue reading” link and “view more text”.
Here’s the original code:
function bavotasan_front_page_render() { global $wp_query, $paged; ?> <?php while ( have_posts() ) : the_post(); ?> <?php if ( is_front_page() ) { ?> <div class="item"> <figure class="effect-julia"> <?php if ( has_post_thumbnail() ) the_post_thumbnail( 'home' ); else echo '<img src="' . BAVOTASAN_THEME_URL . '/library/images/no-image.jpg" alt="" />'; ?> <figcaption> <h2><?php the_title(); ?></h2> <div> <p><?php echo wp_trim_words( strip_shortcodes( get_the_excerpt() ) , 10 ); ?></p> <p class="more-link-p"><?php _e( 'Continue reading <span class="meta-nav">→</span>', 'destin' ); ?></p> </div> <a href="<?php the_permalink(); ?>"><?php _e( 'View more', 'destin' ); ?></a> </figcaption> </figure> </div> <?php } else { ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php } ?> <?php endwhile; ?> <?php } add_action( 'wp_head', 'bavotasan_styles' );
I tried with remove_action as read on varios places but I don’t know where am I wrong. Every time I get that error:
“Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘altered_bavotasan_styles’ was given in /web/htdocs/www.crea11.it/home/studiocrea/wp-includes/plugin.php on line 496”
and here’s the child functions.php commands. what am I mistaking?
function dequeue_bavotasan_styles() { remove_action( 'wp_head', 'bavotasan_styles' ); } add_action('after_setup_theme', 'dequeue_bavotasan_styles'); function altered_bavotasan_front_page_render() { global $wp_query, $paged; ?> <?php while ( have_posts() ) : the_post(); ?> <?php if ( is_front_page() ) { ?> <div class="item"> <figure class="effect-julia"> <?php if ( has_post_thumbnail() ) the_post_thumbnail( 'home' ); else echo '<img src="' . BAVOTASAN_THEME_URL . '/library/images/no-image.jpg" alt="" />'; ?> <figcaption> <h2><?php the_title(); ?></h2> <div> <p><?php echo wp_trim_words( strip_shortcodes( get_the_excerpt() ) , 10 ); ?></p> <p class="more-link-p"><?php _e( 'Cooontinue reading <span class="meta-nav">→</span>', 'destin' ); ?></p> </div> <a href="<?php the_permalink(); ?>"><?php _e( 'Viooooew more', 'destin' ); ?></a> </figcaption> </figure> </div> <?php } else { ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php } ?> <?php endwhile; ?> <?php } add_action( 'wp_head', 'altered_bavotasan_styles' );
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘override functions.php in child theme: where am I wrong?!?’ is closed to new replies.