• LesTexas60

    (@lestexas60)


    I really like the concept of this plugin but I’m having issues getting it to save without an error. I run my PHP code through multiple test sites and they say it is fine but when I load it into the plugin and try to save, I keep getting a error near the bottom . I’m running PHP 7.3. Here is my code:

    $currentpage = $_SERVER[‘REQUEST_URI’];
    if(“/page-6/”==$currentpage) {
    function mytheme_custom_excerpt_length( $length ){
    return 30;
    }
    } elseif (“/page-5/”==$currentpage) {
    echo “Have Good”;
    function mytheme_custom_excerpt_length( $length ) {
    return 10;
    }
    } elseif (“/page-4/”==$currentpage) {
    echo “Have Good”;
    function mytheme_custom_excerpt_length( $length ) {
    return 10;

    }
    }

    add_filter( ‘excerpt_length’, ‘mytheme_custom_excerpt_length’, 999 );

  • The topic ‘Plugin won’t read my code.’ is closed to new replies.