ACF not showing

the_field() function shows the value and it doesn’t get/return anything. Like the_title() and other template tags starting with the_. It means that: This line prints the value and $hero variable is empty. $hero = the_field(‘hero_title’); This line prints only <h1> tags. echo ‘<h1>’.$hero.'</h1>’; What you want is: echo ‘<h1>’ . get_field(‘hero_title’) . ‘</h1>’;

Overrite parent functions using child functions

You can’t just redeclare the function in the child theme or call add_action a second time. It doesn’t replace it, it adds a second hook. As a result, you haven’t overriden it, you’ve duplicated the original. Child theme overrides only work for templates. What’s more, by adding a second definition of wp_bootstrap_starter_custom_header_setup you’ve declared the … Read more

filemtime(): stat failed warning within a child theme

The problem is in your parent theme. The parent theme is using get_stylesheet_directory() here: filemtime(get_stylesheet_directory() . ‘/dist/css/custom-style.css’), When the parent theme is active, that’s fine, because get_stylesheet_directory() will point that file in the parent theme. The problem is that when you activate a child theme, it is trying to get the filemtime() of ‘/dist/css/custom-style.css’ in … Read more

How do I get the trackback count of a post in wordpress without writing an SQL query?

You can specify what kind of comment you want to retrieve using get_comments(). // Assumes you’ve set $post_id somewhere. $args = array( ‘type’ => ‘trackback’, ‘post_id’ => $post_id, ); $trackbacks = get_comments( $args ); $trackback_count = count( $trackbacks ); Edited to add: As Sally CJ points out in the comments, you can do this in … Read more