Odpowiedź forum utworzona

Zobacz 1 odpowiedź (z 1 wszystkich)
  • Twórca wątku Deotho

    (@deotho)

    Dodałem do functions.php:

    function custom_excerpt_length( $length ) {
    	return 20;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 200 );

    I zmieniłem z the_content na the_except i nie działa. :/

    Fatal error: Call to undefined function add_filter() in /home/beosky1/domains/lordareon.eu/public_html/wp-includes/functions.php on line 4688

    @edit
    Dobra wystarczyło

    function custom_excerpt_length( $length ) {
    	return 20;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 200 );

    zamienić na

    function custom_excerpt_length( $length ) {
    	return 20;
    	$length = apply_filters( 'excerpt_length', 'custom_excerpt_length', 200 );
    }

    ale nadal wyświetla ponad 200 znaków :/

Zobacz 1 odpowiedź (z 1 wszystkich)