SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2013
    Location
    Philippines
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

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

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

    Code:
    <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.

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

    When I hovered on the tab an error appeared:

    http://i255.photobucket.com/albums/h...ps2c22f473.jpg

  2. #2
    SitePoint Addict deadmix's Avatar
    Join Date
    Jun 2009
    Location
    france
    Posts
    205
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Use this code instead :

    Code:
    <title><?php
    	/*
    	 * Print the <title> tag based on what is being viewed.
    	 */
    	global $page, $paged;
    
    	wp_title( '|', true, 'right' );
    
    	// Add the blog name.
    	bloginfo( 'name' );
    
    	// Add the blog description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		echo " | $site_description";
    
    	// Add a page number if necessary:
    	if ( $paged >= 2 || $page >= 2 )
    		echo ' | ' . sprintf( __( 'Page %s' ), max( $paged, $page ) );
    
    	?></title>
    Goodluck


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •