torimc125 (@torimc125)

Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

  • torimc125
    Participant

    @torimc125

    I did!  I have corrected the error and now I am up and running. Thank you so much!  


    torimc125
    Participant

    @torimc125

    Hi Robin: Thank you again for your reply.  I copied the code you provided and pasted it into Code Snippets. Now I get this error message: 

    “The snippet has been deactivated due to an error on line 3:
    Cannot redeclare function to_archive_title_remove_prefix.

    Any other suggestions?
    Victoria


    torimc125
    Participant

    @torimc125

    Thank you, Robin, for your reply. I downloaded Code Snippets and I added the above line, you provided, wp-content/themes/%your-theme-name%/functions.php. I changed %your-theme-name% to my theme, but I receive this fatal error.

    Don’t Panic
    The code snippet you are trying to save produced a fatal error on line 1:
    syntax error, unexpected end of file

    Was I supposed to add the below to code snippet?

    add_filter( ‘get_the_archive_title’, ‘to_archive_title_remove_prefix’ );
    function to_archive_title_remove_prefix( $title ) {
    if ( is_post_type_archive() ) {
    $title = post_type_archive_title( ”, false );
    }
    return $title;
    }


    torimc125
    Participant

    @torimc125

    Thank you @robin-w and @timmy321 for providing your solution. I have the exact issue. This is my first time working with a child’s theme. I actually had to read how to install one, so I learned another lesson working through this issue. Since this is all new to me, can someone tell me where within the functions.php content I should add the “fix verbiage”? Can I add it anywhere above my last line, or does it need to go before or after some other functions definition? I will continue to search for an answer in other areas, but I figured it wouldn’t hurt to ask. Thank you in advance. Victoria

Viewing 4 replies - 1 through 4 (of 4 total)