Skip to content

Instantly share code, notes, and snippets.

@Nikschavan
Last active May 18, 2018 07:02
Show Gist options
  • Save Nikschavan/b6c5d2488e4cf4e0e072ff5f4f9bf4ff to your computer and use it in GitHub Desktop.
Save Nikschavan/b6c5d2488e4cf4e0e072ff5f4f9bf4ff to your computer and use it in GitHub Desktop.
Disable title on all pages - Astra WordPress Theme
<?php // don't copy this line in your code
/**
* Disable title on all post types.
*/
function your_prefix_post_title() {
$post_types = array(
'post',
'page',
'testimonials' // Add your post type slug's.
);
// bail early if the current post type if not the one we want to customize.
if ( ! in_array( get_post_type(), $post_types ) ) {
return;
}
// Disable Post featured image.
add_filter( 'astra_the_title_enabled', '__return_false' );
}
add_action( 'wp', 'your_prefix_post_title' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment