[Resolved] Custom post type taxonomy page header template tag strips post title

Home Forums Support Custom post type taxonomy page header template tag strips post title

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • #481340

    I’ve got a custom post type (made with Easy Content Types) “Team” where the Team post title is the person’s name.

    Team has a custom taxonomy called “Divisions” which has “Leadership Team” “Marketing Team” etc. I made a page header for this taxonomy using the template tag {{post_title}} but it removes the actual post title, which is the person’s name, entirely from the listed post.

    What it should look like:
    What I want

    What I’m getting:
    What I get

    Is there any way this can be fixed so there’s a template tag for custom post type taxonomies that doesn’t strip the actual post title away?

    GeneratePress 2.0.1
    GP Premium 1.5.6
    Customer Support

    Hi there,

    Are you able to link us to the page in question?


    Yes, I am able. 🙂 I migrated it (it’s still just a local dev site I’m working on) to a live server » HERE so you can see it.

    Let me know if you guys need admin credentials to log in to the back end, as well.

    Lead Developer
    Lead Developer

    Interesting, that template tag is built to work with static pages and posts – haven’t played with it much on archive pages. I’ll take a look to see if this is something I can fix in the next version of GPP.

    For now, you can create page headers specifically for these archive pages, and manually input the title.


    Thanks, Tom.

    In regard to “For now, you can create page headers specifically for these archive pages, and manually input the title.” Yes, I realize that. I realized I had to do that for the Team cpt archive 🙁 and did. But the point of this is to create a blueprint site that I can make as turnkey as possible. Regarding the custom post types, if I have clients who wish to add content that includes new cpt taxonomies, then I need to automatically (via the template tag) populate that page header, since the client will not have access or the ability to manually create a new page header for every new taxonomy.

    It’s my understanding from the GP documentation that the {{post_title}} template tag ” will also pick up the current taxonomy title if the Page Header is applied to a taxonomy (category, tag etc..).” This is the information I based this on.

    Thanks in advance for any help with this.

    Lead Developer
    Lead Developer

    I just tested this here: http://tomusborne.com/dev/?cat=1

    I tested it as a global location and set directly to the category.

    The page header is using {{post_title}}, and the title of the posts are left alone.

    I just checked your site again and it’s working – have you switched them to manually entering the title?


    Hi Tom,

    The custom post type archive (in my case “Team”) works fine, as long as I do a manual page header. The problem was, and still is, with the cpt taxonomy. If you look again, the problem on my site is with the taxonomy (divisions) archive: “Leadership Team (CPT Tax Archive)“. You’ll see there that the post title (the guy’s name) is missing.

    It looks like what you did on your example was a category archive. I’m having issues with the taxonomy.

    Lead Developer
    Lead Developer

    Is that custom taxonomy using any custom page templates?

    Page Headers can only remove the title if it’s wrapped in this function: https://github.com/tomusborne/generatepress/blob/2.0.2/content-page.php#L25-L31

    However, only pages have that function.

    Since this is a single post in a taxonomy, it shouldn’t exist: https://github.com/tomusborne/generatepress/blob/2.0.2/content.php#L34


    Ohmigosh, that was it. The taxonomy-divisions.php cpt template was the *&^%$# source of the issue. Once I removed that, the person’s name (page title) showed up again. Your pointing out the functions and asking about the custom template was enough to jar my poor tired brain cells to what the issue was. Now I can move on.

    Thanks so much again for taking the time to look at this and for your quick help!

    Lead Developer
    Lead Developer

    Awesome! You’re very welcome 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.