Making WordPress.org

Changeset 8198


Ignore:
Timestamp:
02/05/2019 08:17:53 AM (6 years ago)
Author:
dd32
Message:

Main Theme: Add a Canonical Tag, Meta Description, and GTM code to /downloads/counter/.

Fixes #4137.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/page-download-counter.php

    r7432 r8198  
    1212$branch = WP_CORE_STABLE_BRANCH;
    1313
     14$canonical_url = get_permalink();
     15
    1416if (
    1517    isset( $_GET['branch'] )
     
    1820) {
    1921    $branch = $matches[0];
     22
     23    $canonical_url = add_query_arg( 'branch', $branch, $canonical_url );
    2024}
    2125
     
    4448    /* translators: 1: version number; 2: download count; */
    4549    $text = __( 'WordPress %1$s has been downloaded %2$s times', 'wporg' );
     50
     51    /* translators: 1: date; 2: version number; 3: download count; */
     52    $meta_desc_text = __( 'As of %1$s, WordPress %2$s has been downloaded over %3$s times - watch that number increase in real time!', 'wporg' );
    4653} else {
    4754    /* translators: 1: version number; 2: download count; */
    4855    $text = __( 'WordPress %1$s was downloaded %2$s times', 'wporg' );
    49 }
     56
     57    /* translators: 1: date; 2: version number; 3: download count; */
     58    $meta_desc_text = __( 'As of %1$s, WordPress %2$s was downloaded over %3$s times.', 'wporg' );
     59}
     60
     61// Page meta description
     62$meta_desc_text = sprintf(
     63    $meta_desc_text,
     64    date_i18n( 'F jS Y' ),
     65    $branch,
     66    number_format_i18n( $num )
     67);
     68
    5069?>
    5170<!DOCTYPE html>
     
    5675    <link href="//fonts.googleapis.com/css?family=Open+Sans:300" rel="stylesheet" type="text/css">
    5776    <meta name="viewport" content="width=device-width,initial-scale=1.0">
     77    <link rel="canonical" href="<?php echo esc_url( $canonical_url ); ?>">
     78    <meta name="description" conntent="<?php echo esc_attr( $meta_desc_text ); ?>">
     79    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
     80new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
     81j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
     82'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
     83})(window,document,'script','dataLayer','GTM-P24PF4B');</script>
    5884    <style type="text/css">
    5985        html,
     
    191217
    192218<body>
     219    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P24PF4B" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    193220    <div class="something-semantic">
    194221        <div class="something-else-semantic">
Note: See TracChangeset for help on using the changeset viewer.