Skip to content

Commit

Permalink
Fix Sitemap links (#2105)
Browse files Browse the repository at this point in the history
- fix post links
- fix category links
- move up empty condition to avoid empty category
- fix font-family for list content
  • Loading branch information
lithrel authored Aug 30, 2023
1 parent b143724 commit 042c95a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assets/src/scss/pages/_sitemap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

a {
color: var(--body--color);
font-family: var(--headings--font-family);

&:visited,
&:active,
Expand All @@ -17,6 +16,7 @@
}

h5 {
font-family: var(--headings--font-family);
margin-bottom: 1rem;
}

Expand Down
2 changes: 1 addition & 1 deletion page-templates/sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
$context['custom_body_classes'] = 'white-bg';
$context['page_category'] = 'Sitemap Page';

if (get_theme_mod('new_identity_styles')) {
if (!empty(planet4_get_option('new_ia'))) {
$context['categories'] = get_categories(['orderby' => 'name', 'order' => 'ASC']);
$context['posts'] = [];
foreach ($context['categories'] as $cat) {
Expand Down
8 changes: 4 additions & 4 deletions templates/sitemap.twig
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@
{% endif %}
{% if categories %}
{% for cat in categories %}
{% if posts[cat.term_id] is not empty %}
<div class="col-md-5 order-md-2 order-lg-3 col-lg-3">
{% if posts[cat.term_id] is not empty %}
<h5 class="mb-3 mt-5 mt-lg-0">
<a href="{{ function('get_permalink', cat.term_id) }}">{{ cat.name }}</a>
<a href="{{ function('get_category_link', cat.term_id) }}">{{ cat.name }}</a>
</h5>
<ul>
{% for post in posts[cat.term_id] %}
<li><a href="{{ post.url }}">{{ post.post_title }}</a></li>
<li><a href="{{ function('get_permalink', post.ID) }}">{{ post.post_title }}</a></li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endif %}
{% endfor %}
{% endif %}
</div>
Expand Down

0 comments on commit 042c95a

Please sign in to comment.