- This topic has 9 replies, 3 voices, and was last updated 6 years, 1 month ago by Tom.
-
AuthorPosts
-
January 27, 2018 at 1:28 pm #481340Ria
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’m getting:
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?
January 27, 2018 at 5:52 pm #481414LeoStaffCustomer SupportHi there,
Are you able to link us to the page in question?
January 28, 2018 at 8:05 am #481777RiaYes, 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.
January 28, 2018 at 10:13 am #481859TomLead DeveloperLead DeveloperInteresting, 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.
January 28, 2018 at 10:24 am #481865RiaThanks, 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.
January 28, 2018 at 7:48 pm #482091TomLead DeveloperLead DeveloperI 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?
January 29, 2018 at 6:13 am #482453RiaHi 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.
January 29, 2018 at 11:25 am #482789TomLead DeveloperLead DeveloperIs 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
January 29, 2018 at 12:16 pm #482888RiaOhmigosh, 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!
January 29, 2018 at 12:17 pm #482890TomLead DeveloperLead DeveloperAwesome! You’re very welcome π
-
AuthorPosts
- You must be logged in to reply to this topic.