Forum

Thread tagged as: Problem, Blog

Blog tag URLs not outputting

I have an issue where my blog tags are not outputting the full URL.

For example the URL is output as just https://somesite.com/tag/ rather than https://something.com/tag/test

What I've tried

I've tried adding the blog app from scratch and, using the default post.php template and I'm having the same issue.

You can see this issue on my live site, for example https://jaygeorge.co.uk/blog/w3-total-cache-for-wordpress-users (scroll down to where the categories and tags are output, just before the comments). It seems like the categories URLs are fine, but the tags are short of the full URL.

PHP template code

Here is my post.php template code:

<?php include('../perch/runtime.php'); ?>

<?php perch_layout("global/head", array('blog-post' => true)); ?>
<?php perch_layout("global/header"); ?>

    <div class="s-single">

    <?php perch_blog_post(perch_get('s')); ?>

    <?php /* perch_blog_author_for_post(perch_get('s')); */ ?>

    <div class="entry-footer">
    <div class="entry-meta">
        <div class="entry-categories-and-tags entry-categories-and-tags--categories">
                <?php perch_blog_post_categories(perch_get('s')); ?>
        </div>
        <div class="entry-categories-and-tags entry-categories-and-tags--tags">
                <?php perch_blog_post_tags(perch_get('s')); ?>
        </div>
    </div>
    </div>

    <?php perch_blog_post_comments(perch_get('s')); ?>

    <?php perch_blog_post_comment_form(perch_get('s')); ?>

    </div>

<?php perch_layout("global/footer"); ?>
Jay George

Jay George 2 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show us the template you're using for perch_blog_post_tags() ?

Ah hah…

That prompted me to remember that some of my blog templates were overriding the blog app.

I diff'd the two and noticed, in an effort to mirror my previous WordPress site, I must have replaced:

<li><a href="archive.php?tag=<perch:blog id="tagSlug" />"

with

<li><a href="tag/<perch:tag id="tagSlug" />"

Which I now realise would have broken the query. Silly me.