• Resolved flohog

    (@flohog)


    Hi there!
    Another question: I would like to hide the page title when displaying a post category.
    You helped me to hide the header (I asked for it, but didn’t mean it – my fault), so is there a way? It is possible for the blog and blog entries via Customizer, but not for the category I guess.

    Any help highly appreciated!
    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author oceanwp

    (@oceanwp)

    Hello, use this code: https://docs.oceanwp.org/article/437-disable-the-page-title
    Replace “is_singular( ‘post’)” by “is_category[)”.

    Thread Starter flohog

    (@flohog)

    Hi,
    and thanks. Unfortunately I get a http 500 error when doing this:

    // Disable page title on category view
    function disable_title( $return ) {
     
        if ( is_category() ) {
            $return = false;
        }
     
        // Return
        return $return;
        
    }
    add_filter( 'ocean_display_page_header', 'disable_title' );

    Did I miss something?

    Theme Author oceanwp

    (@oceanwp)

    Hi, try to add a prefix to your function because this code works, I just tried it.
    So try something like this:

    // Disable page title on category view
    function myprefix_disable_title( $return ) {
     
        if ( is_category() ) {
            $return = false;
        }
     
        // Return
        return $return;
        
    }
    add_filter( 'ocean_display_page_header', 'myprefix_disable_title' );
    Thread Starter flohog

    (@flohog)

    That worked! Awesome support, guys! Crazy!

    Theme Author oceanwp

    (@oceanwp)

    You’re welcome ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Category page title’ is closed to new replies.