OceanWP comes with a nice built in page heading area but when adding custom post types it is hard to manage how the headings are displayed.

In some cases you may notice redundant page headings – specifically in the page subheading. To remove the page subheading from custom post type archives use the following code:

// Remove the subheading from our custom post type archive pages
function remove_oceanwp_subheading( $subheading ) {
    if ( is_post_type_archive( array('post-type-archive1', 'post-type-archive2') ) ||is_tax(array('tax-archive-1', 'tax-archive-2') )) {
        $subheading = false;
    }
    // Return the subheading
    return $subheading;
}
add_filter( 'ocean_post_subheading', 'remove_oceanwp_subheading' );

Leave a Reply

Get in Touch

Please fill out the form below and we will get back to you ASAP

  • This field is for validation purposes and should be left unchanged.