Forums

Modifying title tag for paged search results (1 post)

  1. PandeBCN
    Member
    Posted 1 week ago #

    I want to add the number of the page when some search has more than one page because actually the title tag is the same for page 1, 2, 3, etc.

    I don't know what to add to the title tag to show the number of the page to avoid duplicity.

    This is what I have now in my header:

    <title><?php if ( get_bloginfo('version') < '2' ) : echo
    wp_title('',false); if ( !is_home() ) : echo ' | '; endif;
    elseif ( is_search() ) : echo wp_specialchars($s).' en ';
    elseif ( is_category() ) : single_cat_title(''); echo ' | ';
    elseif ( is_tag() ) : single_tag_title(''); echo ' escrito en ';
    elseif ( is_year() ) : echo get_the_time('F').' | ';
    elseif ( is_month() ) : echo get_the_time('F \d\e\l Y').' | ';
    elseif ( is_day() ) : echo get_the_time('j \d\e F \d\e Y').' | ';
    elseif ( is_404() ) : echo "No Encontrado | ";
    elseif ( !is_home() ) : if ( get_the_title() ){ the_title(); }else{
    echo "Sin t&iacute;tulo"; }; echo " | ";
    endif // is_search() ?>
    <?php bloginfo('name') ?></title>

    Thanks

Reply

You must log in to post.

About this Topic