Insert Content Before div#main from the functions.php File

The markup surrounding the content is not specified by WordPress, so there is no hook for that. But you can declare your own hook there. In your template file, write … <?php do_action( ‘before_content_container’ ); ?> <div class=”main”> <?php the_content(); ?> </div> <?php do_action( ‘after_content_container’ ); ?> … and then you can register a callback … Read more

Is it possible to use add_filter in an included file in the child theme’s functions.php?

What you’re trying to do is possible. When including php files, use get_stylesheet_directory() in child themes and get_template_directory() in parent themes. E.g. require_once( get_stylesheet_directory() . ‘/inc/myfile.php’); get_stylesheet_directory_uri() and get_template_directory_uri() will return URLs. Those functions are useful when enqueuing public assets such as stylesheets and JavaScript. Also, setting allow_url_include to Off in your php.ini will provide … Read more

Can not using get_header() cause trouble (later on)?

As long as the wp_head() function is still being called in the template, you should be fine. You’ve pretty much summed it up in your question; by not using get_header(), the get_header action will not be fired, but that wouldn’t matter for your particular use case. Using get_header() along with the name parameter would be … Read more

Changing where my author box is printed

You could change the function to echo like this: echo apply_filters(‘the_content’, $content); and then in your template, right before the comments template, place the call to your author box function like this: author_info_box(); also, you would need to remove the add_action(‘the_content’, ‘author_info_box’); Full function example: function author_info_box() { global $post; // Detect if it is … Read more

Hooking dynamic/variable named hook in all cases

Unfortunately there is no global transient filter – you’d either need to know all the transient names you want to target, or you’ll have to use the special all hook (which runs for all actions and filters)