Having trouble fixing my title in WordPress

I’m using this code in order to display what page the user is.

<title><?php 
    global $page, $paged; 
    wp_title( '|', true, 'right' ); 
    bloginfo( 'name' ); 
    $site_description = get_bloginfo( 'description', 'display' ); 
    if ( $site_description && ( is_front_page() ) )
        echo " | $site_description"; 
    if ( $paged >= 2 || $page >= 2 ) 
        echo ' | ' . sprintf( __( 'Page %s' ), x( $paged, $page ) ); 
?></title>

When clicking on the navigation it seem to be working properly and it also displays the correct title. But when I click on the pagination, the website shows only a blank page.

Read More

I’m using WP-PageNavi plugin to display the pagination.

When I hovered on the tab an error appeared:

enter image description here

Related posts

Leave a Reply

1 comment

  1. Please check the second last line in your code block.

    You have “x( $paged, $page ) );”

    I think you should remove the “x”, character.

    EDIT: in fact, the correct (and accepted) solution is to replace “x” with “max” (see comment below)