• Hi. I have used this snippet on FRONTEND only:

    function prefix_category_title( $title ) {
    if ( is_category() ) {
    $title = single_cat_title( ”, false );
    } elseif ( is_tag() ) {
    $title = single_tag_title( ”, false );
    }
    return $title;
    }
    add_filter( ‘get_the_archive_title’, ‘prefix_category_title’ );

    But, it is not working. Please help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Hello,

    Have you tried using this snippet with the default theme enabled? Or using a more simplified version like this:

    add_filter( 'get_the_archive_title', function ( $title ) {
        return 'TEST';
    } );
    Thread Starter nihalkumar

    (@nihalkumar)

    Yes. Even this simplified code is not working!

    Plugin Author Shea Bunge

    (@bungeshea)

    Hi @nihalkumar,

    Can I ask, are your other front-end snippets working? Have you tried switching to the default theme temporarily and seeing if that changes things?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Code Snippet not working’ is closed to new replies.