• Hello, i have a problem with get_the_categoy.

    In the category page i have this:

    <?php
    // Definire l’elenco degli ID da escludere
    $exclude = Array(28,22218,22291,22289,22292,9292);
    foreach((get_the_category()) as $category) {
    if (!in_array($category->cat_ID, $exclude)) {
    echo “<-a>cat_name’> $category->cat_name <-a>”;
    }
    }
    ?>

    How do I limit the echo to show only the first word?

The topic ‘Php limit in get_the_category’ is closed to new replies.