Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #5492

    I´m again… in the main index I would like to show only 200 caracteres… how can I change this code:?

    the_content(__(‘Read more’,’avia_framework’));

    Thanks

    #50536

    Hey,

    you can use following code:

    echo substr(strip_tags($post->post_content), 0, 200);

    #50537

    I put this way and this doesn´t works: (in the file “includes/loop-bloghome.php”)

    <?php

    $cats = get_the_category();

    if(!empty($cats))

    {

    /*

    the_category(‘, ‘) ;

    the_content(__(‘Read more’,’avia_framework’));

    */

    substr(strip_tags($post->post_content), 0, 200);

    }

    ?>

    #50538

    Of course it doesn’t work. You need to echo the result or save it in a variable….

    #50539

    thnks a lot… it works!!!

    #50540

    Glad that I could help you :)

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Howto get substring of the_content() ???’ is closed to new replies.