Tagged: 

Viewing 29 posts - 1 through 29 (of 29 total)
  • Author
    Posts
  • #472221

    Hello,

    I have been reading that google’s preferred method of pagination should include a ‘view all’ option in the pagination structure. So, my first question is can a view all link be added to the pagination?

    “Google’s preferred first choice for handling most pagination issues is to create a separate “View-All” page apart from the paginated series and include all of the items within this single page. Once you’ve created the View-All page, you can then place a rel=”canonical” tag within the <head> section of each paginated component page, pointing to the View-All Page. (e.g. <link rel=”canonical” href=”http://www.site.com/view-all-page”/&gt;). This will essentially tell Google to treat each specific page in a paginated series as a segment of the View-All page and queries will return the View-All page as opposed to a relevant segment page of the pagination chain.”

    Second question relates to the above. How can a rel attribute be added interdependently to specific portfolio category pages?

    Thanks – Andrew

    #472953

    Hey Andrew!

    You don’t necessarily need to add a View All link to the pagination links, what you need to do is:
    1. Create a View All page showing all items at once.
    2. Place the rell tag on all paginated screens, you can use the following code (functions.php) for that:

    add_action('wp_head', function() {
    	if ( is_paged() ){
    ?>
    <link rel=”canonical” href=”http://www.site.com/view-all-page”/>
    <?php
            }
    });

    Regards,
    Josue

    #472981

    Thanks for the information Josue,

    This would cause a problem though because I have 4 portfolio categories (which are different items) so I would need to add a view all
    page for each portfolio category – how would I do that?

    Also, in your code above, how would the viewer know about the ‘view all’ page if it is not listed within the pagination?

    Thanks again,

    Andrew

    #472985

    Below is the page that launches the portfolio categories

    #472993

    That’s up to you, you can point the link tag to the category index, or that page you’ve just linked or to a new page, use the following codes to add the tags for each one (IDs are already set, just change the href in each one):

    <?php
    add_action('wp_head', function() {
    	if ( is_page (3841) ){ // http://www.emailweddingcard.com/email-wedding-card-designs/box-style-email-wedding-card-design/
    		echo '<link rel="canonical" href="http://www.site.com/view-all-page"/>';
    	} elseif ( is_page (3352) ){ // http://www.emailweddingcard.com/email-wedding-card-designs/royal-scroll-email-wedding-cards/
    		echo '<link rel="canonical" href="http://www.site.com/view-all-page"/>';
    	} elseif ( is_page (2957) ){ // http://www.emailweddingcard.com/email-wedding-card-designs/pocket-fold-email-wedding-cards/
    		echo '<link rel="canonical" href="http://www.site.com/view-all-page"/>';
    	} elseif ( is_page (3527) ){ // http://www.emailweddingcard.com/email-wedding-card-designs/letter-style-email-wedding-cards/
    		echo '<link rel="canonical" href="http://www.site.com/view-all-page"/>';
    	}else{
    
    	}
    });

    Regarding a view all link, although you could add it with some custom coding it’s not necessary per your initial request as this tags are meant to be read by Google robots and not the user.

    Cheers!
    Josue

    #473004

    Thanks Josue, I’ll give it a go!

    Andrew

    #473008

    Just to clarify

    #473018

    Yeah, having a look at your actual set-up is_paged would not be ideal, try with the last block of code.

    Regards,
    Josue

    #473024

    So just this code?

    #473039

    Correct.

    #473041

    Thanks again.

    #473048

    You are welcome, glad to help :)

    Regards,
    Josue

    #473086

    Hello

    When I add the code exactly as seen in the box below it breaks the site (white screen) – can you give the code a quick check please. I have tried adding it to the top and bottom of the functions.php file.

    #473116
    add_action('wp_head', function() {
    if ( is_page (3841) ){ // http://www.emailweddingcard.com/email-wedding-card-designs/box-style-email-wedding-card-design/
    echo '<link rel="canonical" href="http://www.emailweddingcard.com/email-wedding-card-designs/all-box-style-email-wedding-card-templates/"/>';
    } elseif ( is_page (3352) ){ // http://www.emailweddingcard.com/email-wedding-card-designs/royal-scroll-email-wedding-cards/
    echo '<link rel="canonical" href="http://www.emailweddingcard.com/email-wedding-card-designs/all-scroll-style-email-wedding-card-templates/"/>';
    } elseif ( is_page (2957) ){ // http://www.emailweddingcard.com/email-wedding-card-designs/pocket-fold-email-wedding-cards/
    echo '<link rel="canonical" href="http://www.emailweddingcard.com/email-wedding-card-designs/all-pocket-fold-email-wedding-card-template-designs/"/>';
    } elseif ( is_page (3527) ){ // http://www.emailweddingcard.com/email-wedding-card-designs/letter-style-email-wedding-cards/
    echo '<link rel="canonical" href="http://www.emailweddingcard.com/email-wedding-card-designs/all-letter-style-email-wedding-card-templates/"/>';
    }else{
    
    }
    });

    If you are putting it at the end of functions.php put it without the <?php, also copy it from the forum reply and not from the mail notification.

    #473129

    Thanks, that worked however something strange. In the code below (I didn’t see this before) there is already a rel=”canonical” for the portfolio category, not the ‘all portfolio items’ I just created. Any idea why or how this is there? You can view the one I didn’t put there at the top of the code below and the new one at the bottom. Presumably it’s not wise to have 2?

    #473133

    Hello,

    Are you using any SEO plugins in addition to that? have you tried disabling all third-party plugins to see if what happens?

    Regards,
    Josue

    #473150

    No seo plugins.

    #473155

    Just turned off all plugins and still see it.

    #473162

    It seems that WP now adds canonical links to all pages – http://pixelpunk.co.uk/2010/01/disable-wordpress-built-in-canonical-url/
    Which can be turned off. I am going to test it to see if the code you provided is removed when I turn off the default wordpress canonical but should your example use:

    rel=”canonical”

    or

    rel=’canonical’

    #473164

    If you are referring to the quotes, it doesn’t really matter.

    #473167

    Ok, that seems to work. In your opinion is it wise to turn off the global canonical parameter?

    Thanks – Andrew

    #473185

    You could change the code so the canonical removal only occurs on those pages:

    add_action('wp_head', function() {
    if ( is_page (3841) ){ // http://www.emailweddingcard.com/email-wedding-card-designs/box-style-email-wedding-card-design/
    	echo '<link rel="canonical" href="http://www.emailweddingcard.com/email-wedding-card-designs/all-box-style-email-wedding-card-templates/"/>';
    } elseif ( is_page (3352) ){ // http://www.emailweddingcard.com/email-wedding-card-designs/royal-scroll-email-wedding-cards/
    	echo '<link rel="canonical" href="http://www.emailweddingcard.com/email-wedding-card-designs/all-scroll-style-email-wedding-card-templates/"/>';
    } elseif ( is_page (2957) ){ // http://www.emailweddingcard.com/email-wedding-card-designs/pocket-fold-email-wedding-cards/
    	echo '<link rel="canonical" href="http://www.emailweddingcard.com/email-wedding-card-designs/all-pocket-fold-email-wedding-card-template-designs/"/>';
    } elseif ( is_page (3527) ){ // http://www.emailweddingcard.com/email-wedding-card-designs/letter-style-email-wedding-cards/
    	echo '<link rel="canonical" href="http://www.emailweddingcard.com/email-wedding-card-designs/all-letter-style-email-wedding-card-templates/"/>';
    } elseif ( is_page( array( 3831, 3352, 2957, 3527 ) ) ){
    	remove_action('wp_head', 'rel_canonical');	// this runs on those pages only
    } else {}
    }, 1);
    

    Best regards,
    Josue

    #473200

    Thanks for that Josue,

    Once again you’ve been a great help.

    Andrew

    #473204

    Can I just double check the code with you because it still shows 2 (at the top and the bottom)

    #473421

    Hi,

    Can you please create us a WordPress administrator account? post it here as a private reply.

    Regards,
    Josue

    #473457

    Sure, its listed below.

    #474189

    Should work now, check the source code.

    Best regards,
    Josue

    #474214

    Thanks Josue, it is ok now. Just so I know was it just something you changed in the functions.php file, if so I can just copy and save it.

    #474588

    Yes, you can check the code at the end of your theme functions.php.

    Best regards,
    Josue

Viewing 29 posts - 1 through 29 (of 29 total)
  • You must be logged in to reply to this topic.