WordPress.org

Forums

Custom page for certain tags returning no posts (1 post)

  1. rprince
    Member
    Posted 9 months ago #

    Hi there,

    I am trying to build a theme where the tag pages for tags that match a certain regex (e.g. if the tag contains certain keywords), are displayed in a custom way (in my case, like a newsletter).

    I have this working on a local development multisite, but when I put it on the live server (which is a one-click-install single site), it displays "Nothing Found" for those tag pages. There is definitely content with the tag, as it list the tag with various posts under normal content listings, and if I remove the template_include hook, it reverts to using the normal tag.php and displays the posts.

    You can see a working tag page here:
    http://www.lordshillroadrunners.org.uk/tag/membership-2/

    You can see the failing custom behaviour here:
    http://www.lordshillroadrunners.org.uk/tag/road-runner-53/

    The code for doing the hook is here:
    http://pastebin.com/8BpiLxB8

    The code for displaying the tag page is here:
    http://pastebin.com/kVbDFriB

    The tag display page is cobbled together from a combination of the usual tag.php and a custom header and footer, because I don't want the site's usual chrome (this is meant to be a way of viewing the newsletter in isolation).

    Has anyone got any suggestions as to what is making WordPress think there are no posts with that tag, please? I've tried rewind_posts just before the have_posts call, but that didn't work.

    What I don't get is why it works on my local installation, but not on the live server :-( I'm surprised the slight change in environment is having this effect.

    Cheers,
    Rikki

Reply

You must log in to post.

About this Topic