• In my Archive.php, I use:

    <?php if (have_posts()) : ?>
    <?php if ( is_day() ) : ?>
    <?php printf( __( 'Daily Archives: %s', '' ), get_the_date() ); ?>
    <?php elseif ( is_month() ) : ?>
    <?php printf( __( 'Monthly Archives: %s', '' ), get_the_date('F Y') ); ?>
    <?php elseif ( is_year() ) : ?>
    <?php printf( __( 'Yearly Archives: %s', '' ), get_the_date('Y') ); ?>
    <?php elseif ( is_category() ) : ?>
    <?php printf( __( 'Category: %s', '' ), single_cat_title('', false)); ?>
    <?php elseif ( is_tag() ) : ?>
    <?php printf( __( 'Tag: %s', '' ), single_tag_title('', false) ); ?>
    <?php elseif ( term_exists() ) : ?>
    <?php printf( __( 'Topic: %s', '' ), single_term_title('', false) ); ?>
    <?php else : ?>
    <?php _e( 'Blog Archives', '' ); ?>
    <?php endif; ?>

    Unfortunately, is_term has been deprecated. I looked for a new function and I found some information on WordPress Trac
    http://web.archiveorange.com/archive/v/XZYvyE0ulzRS8YGin3G1

    is_term() was not a conditional statement. It was a check to see whether a term existed. Thus, it was renamed to term_exists().

    So I replaced is_term with term_exists but it doesn’t work and gives me an error:

    Warning: Missing argument 1 for term_exists(), called in /home/folio/www/blog/wp-content/themes/v1/archive.php on line 86 and defined in /homez.517/folio/www/blog/wp-includes/taxonomy.php on line 1449

    So my question is: which working function is replacing is_term?

    Thanks for your help!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘How to replace deprecated is_term?’ is closed to new replies.