Search code examples
phpechoarchive

echo 'archives : ' . single_cat_title(); displays wrong output


My PHP code is giving the wrong output I require.

<h4>
<?php        
    if ( is_category() ) {
        echo 'archives : ' . single_cat_title();
    } elseif ( is_tag() ) {
        echo single_tag_title() . ' : archives';
    } elseif ( is_author() ) {
        the_post();
        echo 'Author archives : ' . get_the_author();
        rewind_posts();
    } elseif ( is_day() ) {
        echo 'Daily archives : ' . get_the_date();
    } elseif ( is_month() ) {
        echo 'Monthly archives : ' . get_the_date('F Y');
    } elseif ( is_year() ) {
        echo 'Yearly archives : ' . get_the_date('Y');
    } else {
        echo 'Archives:';
    }
?>
</h4>

Gives out business archives :, but desire it to be archives : business.

How do I fix this, please

Thanks Steven


Solution

  • single_cat_title('archive : ');
    

    I found my answer, thanks for your help.