Sitemaps: Add wrapping `<div>` around sitemap in stylesheet.

This makes it easier to style the sitemap and for example center the entire content area.

Props ramiy.
Fixes #50622.
Built from https://develop.svn.wordpress.org/trunk@48471


git-svn-id: http://core.svn.wordpress.org/trunk@48240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2020-07-14 11:45:03 +00:00
parent 66c6ad97bc
commit c1ac7b5e16
2 changed files with 59 additions and 55 deletions

View File

@ -91,45 +91,47 @@ class WP_Sitemaps_Stylesheet {
</style> </style>
</head> </head>
<body> <body>
<div id="sitemap__header"> <div id="sitemap">
<h1>{$title}</h1> <div id="sitemap__header">
<p>{$description}</p> <h1>{$title}</h1>
<p>{$learn_more}</p> <p>{$description}</p>
</div> <p>{$learn_more}</p>
<div id="sitemap__content"> </div>
<p class="text">{$text}</p> <div id="sitemap__content">
<table id="sitemap__table"> <p class="text">{$text}</p>
<thead> <table id="sitemap__table">
<tr> <thead>
<th class="loc">{$url}</th>
<xsl:if test="\$has-lastmod">
<th class="lastmod">{$lastmod}</th>
</xsl:if>
<xsl:if test="\$has-changefreq">
<th class="changefreq">{$changefreq}</th>
</xsl:if>
<xsl:if test="\$has-priority">
<th class="priority">{$priority}</th>
</xsl:if>
</tr>
</thead>
<tbody>
<xsl:for-each select="sitemap:urlset/sitemap:url">
<tr> <tr>
<td class="loc"><a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc" /></a></td> <th class="loc">{$url}</th>
<xsl:if test="\$has-lastmod"> <xsl:if test="\$has-lastmod">
<td class="lastmod"><xsl:value-of select="sitemap:lastmod" /></td> <th class="lastmod">{$lastmod}</th>
</xsl:if> </xsl:if>
<xsl:if test="\$has-changefreq"> <xsl:if test="\$has-changefreq">
<td class="changefreq"><xsl:value-of select="sitemap:changefreq" /></td> <th class="changefreq">{$changefreq}</th>
</xsl:if> </xsl:if>
<xsl:if test="\$has-priority"> <xsl:if test="\$has-priority">
<td class="priority"><xsl:value-of select="sitemap:priority" /></td> <th class="priority">{$priority}</th>
</xsl:if> </xsl:if>
</tr> </tr>
</xsl:for-each> </thead>
</tbody> <tbody>
</table> <xsl:for-each select="sitemap:urlset/sitemap:url">
<tr>
<td class="loc"><a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc" /></a></td>
<xsl:if test="\$has-lastmod">
<td class="lastmod"><xsl:value-of select="sitemap:lastmod" /></td>
</xsl:if>
<xsl:if test="\$has-changefreq">
<td class="changefreq"><xsl:value-of select="sitemap:changefreq" /></td>
</xsl:if>
<xsl:if test="\$has-priority">
<td class="priority"><xsl:value-of select="sitemap:priority" /></td>
</xsl:if>
</tr>
</xsl:for-each>
</tbody>
</table>
</div>
</div> </div>
</body> </body>
</html> </html>
@ -199,33 +201,35 @@ XSL;
</style> </style>
</head> </head>
<body> <body>
<div id="sitemap__header"> <div id="sitemap">
<h1>{$title}</h1> <div id="sitemap__header">
<p>{$description}</p> <h1>{$title}</h1>
<p>{$learn_more}</p> <p>{$description}</p>
</div> <p>{$learn_more}</p>
<div id="sitemap__content"> </div>
<p class="text">{$text}</p> <div id="sitemap__content">
<table id="sitemap__table"> <p class="text">{$text}</p>
<thead> <table id="sitemap__table">
<tr> <thead>
<th class="loc">{$url}</th>
<xsl:if test="\$has-lastmod">
<th class="lastmod">{$lastmod}</th>
</xsl:if>
</tr>
</thead>
<tbody>
<xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
<tr> <tr>
<td class="loc"><a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc" /></a></td> <th class="loc">{$url}</th>
<xsl:if test="\$has-lastmod"> <xsl:if test="\$has-lastmod">
<td class="lastmod"><xsl:value-of select="sitemap:lastmod" /></td> <th class="lastmod">{$lastmod}</th>
</xsl:if> </xsl:if>
</tr> </tr>
</xsl:for-each> </thead>
</tbody> <tbody>
</table> <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
<tr>
<td class="loc"><a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc" /></a></td>
<xsl:if test="\$has-lastmod">
<td class="lastmod"><xsl:value-of select="sitemap:lastmod" /></td>
</xsl:if>
</tr>
</xsl:for-each>
</tbody>
</table>
</div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.5-beta1-48470'; $wp_version = '5.5-beta1-48471';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.