First of all, that’s my code:

<?php list_tax_of_project(); ?>





function list_tax_of_project($id = '', $title = '', $taxonomy = 'project_category', $class = '') {

        $class = 'list-categories';
        if ($class = 'skill') $class = 'list-skill';

        $terms = get_the_terms($id, $taxonomy);
        if ($terms && !is_wp_error($terms)): ?>
            <h3 class="title-content"><?php
            printf($title); ?></h3>
            <div class="list-require-skill-project list-taxonomires list-<?php
            echo $taxonomy; ?>">
                <?php
            the_taxonomy_list($taxonomy, '<span class="skill-name-profile">', '</span>', $class); ?>
            </div>
            <?php
        endif;
    }

I’m calling the function list_tax_of_project and I want the result to be the name of the project category on this instance, and it works OK for the first page out of the paginated list on the website page in question, but when you click on page 2 of the paginated lists, the list_tax_of_project function result gets converted to the ID of the categories instead of their titles.

You can check it out live as it happens here: https://consult.law/projects/ . When you click on page 2 from the paginated list at the bottom of the page, the category section will get converted to numbers.

How can I stop this and make it stay with the title instead of converting to IDs? Thanks!

Read more here: Function result converts to IDs instead of title


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: