Support Forum
I tried several things to show taxonomy pages and a kind of a taxonomy cloud on the front end, with no succes.
I made a CPT with several taxonomies that works fine. It shows the content of the CPT on the front end rendered by the single template of my theme with this code in it:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php the_content('Weiterlesen...'); ?>
<?php endwhile; endif; ?>
<?php if ( comments_open() || get_comments_number() ) :
comments_template();
endif;?>
For showing the content I made a View: Type Singular, Location myCPT, All, Only the post content area, Replaces the post content. Every thing works fine.
For showing a list of all my CPTs on one page I use the archive template of my theme with this code in it:
<?php if (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endif; ?>
For showing the content I made a View: Type archive, myCPT Archive, Only the post content area, Replaces the post content. That also works fine.
Now I'd like to be able to click on my taxonomies displayed in the singular page to show all CPTs with the same taxonomy. I use the taxonomy template of my theme for this purpose, with the same code as in the archive template. Then I tried out different versions to create a View for showing the content, but with no succes. The page on the front is generated by the taxonomy template of my theme but it stays empty.
It seems that the permalinks of the displayed contents are OK:
The archive page: .../slug of my cpt/, in my case: .../apps-and-tools/
The single page: .../slug of my cpt/title of my post/, in my case: .../apps-and-tools/shotcut/
The taxonomy page: .../slug of my taxonomy/taxonomy/, in my case .../verwendungszweck/werkzeug/
Any help is greatly appreciated, many thanks in advance.
Wilfried
The Views code might be helpful.
View from the single page:
<h2>
Allgemeines
</h2>
<p>
{% for item in post.loge_hochladen %}
<img src="{{ item.medium.url }}" width="200" height="200" alt="App-Logo">
{% endfor %}<br><br>
<strong>Kurzbeschreibung</strong><br>
{{ post.app_beschreibung }}<br><br>
<strong>Mehr Infos unter:</strong> <a href="{{ post.link_zur_app }}" target="_blank" rel="noopener">{{ post.link_zur_app }}</a><br>
</p>
<h2>
Kosten
</h2>
<p class="aufzaehlung">
<strong>Kostenvarianten:</strong>
{% for item in post.kosten_der_app_oder_des_tools %}
<span class="marker-kosten">{{ item.value }}</span>
{% endfor %}
</p>
<p>
<strong>Weiteres zu den Kosten:</strong><br>
{{ post.details_zu_den_kosten }}
</p>
<h2>
Einordnungnungen
</h2>
<p class="aufzaehlung">
<strong>Nach AVIVA: </strong>
{% for item in post.einordnung_nach_aviva %}
<a href="{{ item.url }}"><span class="marker-aviva">{{ item.name }}</span></a>
{% endfor %}<br>
<strong>Nach Bloom:</strong>
{% for item in post.taxonomy_advanced_bloom %}
<a href="{{ item.url }}"><span class="marker-bloom">{{ item.name }}</span></a>
{% endfor %}<br>
<strong>Bewertungen des Verfassers:</strong>
{% for item in post.bewertung_des_verfasser %}
<span class="marker-verfasser">{{ item.value }}</span>
{% endfor %}
</p>
<h2>
Infos
</h2>
<p class="aufzaehlung">
<strong>Unterstützung:</strong>
{% for item in post.wer_kann_weiterhelfen %}
<a href="{{ item.url }}"><span class="marker-unterstuetzung">{{ item.name }}</span></a>
{% endfor %}<br>
<strong>Verwendungszweck:</strong> <a href="{{ post.verwendungszweck.url }}"><span class="marker-verwendungszweck">{{ post.verwendungszweck.name }}</span></a><br>
<strong>Plattformen:</strong>
{% for item in post.plattformen %}
<a href="{{ item.url }}"><span class="marker-plattformen">{{ item.name }}</span></a>
{% endfor %}<br>
<strong>App Hersteller:</strong> <a href="{{ post.app_hersteller.url }}"><span class="marker-hersteller">{{ post.app_hersteller.name }}</span></a><br>
<strong>Geeignet für:</strong>
{% for item in post.fur_wen_eignet_sich_die_app_oder_das_tool %}
<span class="marker-eignung">{{ item.value }}</span>
{% endfor %}<br>
<strong>Letztmals aktualisiert am:</strong> {{ post.modified_date | date( 'd.m.Y' ) }}
</p>
<h2>
Details
</h2>
<p>
{{ post.testfeld }}
</p>
<div>
<p><strong>App bewerten</strong><br>
[ratings]</p>
</div>
View from the archive page:
<h1>
Alle APPS und TOOLS
</h1>
{% for post in query.posts %}
<h2>
<a href="{{ post.url }}"> {{ post.title }}</a>
</h2>
<div>
<div style="float: left">
{% for item in post.loge_hochladen %}
<img src="{{ item.thumbnail.url }}" width="100" height="100" alt="{{ item.thumbnail.alt }}">
{% endfor %}
</div>
<div>
<p style="padding-left: 110px">
{{ post.app_beschreibung }}
</p>
</div>
</div>
<br><br>
{% endfor %}
{{ mb.get_the_posts_pagination() }}
Many thanks in advance.
Wilfried