Skip Navigation

[Resolved] Having trouble with taxonomy archive

This support ticket is created 7 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

Author
Posts
#460966

I am trying to: Display "preachers" taxonomy archive, showing:
name of preacher as page title
photo and description from the unique person custom post type that has this preacher checked
title (and maybe audio) from each sermon custom post type that has this preacher checked (this part would be similar to hidden link but only for one preacher)

I visited this URL:
hidden link
I expected to see:
name of preacher, Peter Klause, as page title
photo and description for person Peter Klause
title (and maybe audio) from each sermon by Peter Klause

Instead, I got:
name of most recent sermon by Peter Klause as page title
no info on Peter Klause
'no sermons found'

#461109

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Chuck

* A taxonomy archive returns a list of posts which have a taxonomy term assigned.

So if you have a taxonomy "Preachers" which is assigned to the custom post types "Persons" and "Sermons", then when you visit a taxonomy archive (e.g. site.com/preacher/john-smith) then that will show a list of 'persons' and 'sermons' with that taxonomy term.

That is default WordPress behaviour, where what is output on the archive page will be determined by your theme, but you can use Views to customise the taxonomy archive if you wish: https://toolset.com/documentation/user-guides/create-custom-taxonomies/#custom-taxonomy-archives

We have a reference for the views shortcodes you can use, and the relevant part is here, where you will find the shortcodes which output data about the taxonomy: https://toolset.com/documentation/user-guides/views-shortcodes/#displaying-data

(Note that the taxonomy archive is different than taxonomy queries, which return the taxonomy terms rather than posts with the terms assigned.)

* You say you have a Persons post type so that you can show an image and description for a person with a preacher taxonomy assigned. That post type may be redundant. You can add term meta to your custom taxonomy, e.g. add photos and text descriptions.

Please see the following for details:
https://toolset.com/documentation/user-guides/term-fields/
https://toolset.com/documentation/user-guides/displaying-wordpress-term-fields/

I think it would be helpful if you reviewed some of the above links before deciding on the best way to set this up.

If you want to go to a preacher archive page and see their details followed by a list of sermons, then the problem is that the way you have this currently—where preacher is assigned both to persons and sermons—your archive will display both persons and sermons.

You might want to use taxonomy custom fields to add the description and photo of the preacher to the preacher term, so that the taxonomy archive just lists the sermons (after first displaying the preacher custom fields).

Let me know if you need some particular help setting that up.

#461343

Nigel, our 'persons' post type has several person-types, including ministry staff, staff, guest lecturer, elder etc. So we need it.

I created the preacher taxonomy to provide a way of connecting the sermons post type with the persons post type; perhaps it is the taxonomy that is not needed, rather than the persons post type.

I would definitely like some help figuring out how best to do this, we are very late on this project.

On hangouts I'm cwgregory@gmail.com

#461399

Perhaps I should create the taxonomy archive in php, so that I can pull in the relevant information in a more generic fashion?

#461438

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Chuck

I can give this more thought in the morning (here) when I'm back at work, but let me make a couple of observations to give you something to think about.

The taxonomy archive is the wrong route to go down as it will list posts of each post type with that taxonomy term, i.e. sermons and people.

If your aim is to have a page for a given preacher that includes some bio info about them and then a list of their sermons (and possibly some to-be-determined audio posts), then it sounds like you want to treat this as an author archive. That is, make accounts for the preachers so that you can assign them as post authors for the sermons (and audio posts).

You can then have a custom author archive that includes bio info about the preacher (the post author) and lists the content they have authored.

That would be my preferred option, but if for some reason you can't create user accounts for the preachers (they can be entirely administered by the site admin, the preacher need never know they exist) then you'll need another route.

You have a person post for the preacher. So create a content template for a single person which shows the bio info from the custom fields of the person post. You can use conditional codes (https://toolset.com/documentation/user-guides/conditional-html-output-in-views/) to insert a view to show the sermons published by that person. That view would retrieve sermon posts and have a taxonomy filter that takes the term from the current post (which would be the person post currently being viewed).

Have a think about that and if you need some specific guidance implementing it let me know and I'll get back to you tomorrow with more.

#461482

Thank you for your ideas on this. I'm going to add everyone in the 'person' custom type as a user. This will not only let me assign them as authors for the sermons, but also certain other 'persons' need to be usable as 'hosts' for the event plugin and it apparently uses wordpress users for the purpose.

Ideally, the 'person-types' taxonomy could be redefined as user roles, and all the information for the 'person' custom post type would be converted to user meta. This sounds like a big job with lots of ramifications, and we have very limited time till we are expected to go live.

So, I think I'll have the author archive locate the person of the same name and display the info for that, and then display all their sermons.

I am going to start on this but I think I'm going to need help when you get in tomorrow morning.

#461659

Hey, Nigel, are you in? It's 6am here, so within the hours you listed...

I copied all 'persons' to wordpress users with role of author. Made up email addresses since they won't be actual logins in most cases.
I changed all the sermons to have the appropriate author.
I deactivated the Preacher taxonomy.
I got the Sermons view, Sermons widget view, and single Sermons view to work properly using post-author rather than the Preacher taxonomy.

Now, I need to get the Author archive and the Persons archive to work properly.

Once these are done, the other major issue I have is with Events. That's a completely separate issue; the single event display is behaving oddly. Sample:
hidden link
As you can see here, the event content is showing twice, once where I expect it and again below the footer. I need to resolve that, and then do major restructuring of the content that is displayed. My Calendar support says:
===
So, what my filter checks, in order, are:

is_single()
in_the_loop()
is_main_query()
does $post->post_type == 'mc-events'

In order for the replacement to happen, all of these have to be true.

It really doesn't make a lot of sense for this to happen. The $post variable is pulled from global scope, so for that to happen is reasonable; but the check for 'is_main_query()' really shouldn't be returning as true in the footer post.

This seems like a bug in whatever is producing the footer data; it shouldn't be doing anything that causes that query to identify as the main query.
===
The event page is under control of a layout, so he's saying there's a bug in the toolset code, or else in the way I've applied it.

Will appreciate any assistance on either or both of these. Should I create a login for you?

#461699

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Chuck

I read through your replies and I also downloaded a copy of the mc-events plugin you are using to test, but we have a one-issue-per-thread policy (to help other users researching similar problems in our forums) and if there is a compatibility issue with the events plugin that really needs to be reported in a separate ticket.

Sorry for the inconvenience, I know you are in a hurry. When this ticket is closed you will be able to assign the new ticket to me directly, but if you want to keep this ticket open while you make the changes in case you need further help then add the events issue in another ticket and I will keep an eye out for it and pick it up.

#461705

Thanks, Nigel, I realized that I had muddied the waters and I must have been opening the new ticket about the same time you were typing this reply!

On the issue from this ticket, I created an author archive layout but the author archive is still displaying the default sample loop instead. I think this one is almost wrapped up, once we get this latest thing fixed we can proceed to the events issue on the other ticket.

#461745

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

I'm not sure what you have done for your author archive exactly.

You need to create a new layout for the author archive and you need to assign this layout to the standard author archive.

You insert a WordPress archive cell into the layout which is where the list of posts (e.g. sermons) of this author will be displayed, and if this is the first time you do this you may need to insert a new archive and design the output accordingly.

I'm skipping over the details but if that makes sense and is not what you have done so far then please do so, or if you need clarification let me know.

I've asked for site credentials in the other thread so I will be able to look at this, too, if needs be.

#461786

I added the credentials in the other thread; you must have forgotten to hit submit on it since I didn't see you request them.

On this one, I think I missed a step. I created something from the 'wordpress archives' section of toolset, but I don't remember anyplace to insert an archive cell. I'll work on this and let you know if I don't figure it out, now that you explained it a bit more.

So please work on the events thing 😉

Thanks for all your help.

#462015

Hey, Nigel, it seems the other post disappeared. Are you working on the events thing? I've made good progress on the one we opened this ticket for.

#462047

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hey Chuck

I answered your other post a few hours ago to say I had fixed it, I'm not sure how you didn't see it but here it is: https://toolset.com/forums/topic/single-event-layout-shows-content-twice/#post-461959

#462068

Great work on the event thing, I'll pass the info on to mycalendar support as well as he was confused where the issue was coming from.

RE: what started out as having trouble with taxonomy archive...

I added author and text editor to 'persons' custom post type, and assigned each 'person' the author that was the same person. I had previously assigned all sermons to have the appropriate author, and deactivated the preacher taxonomy.

Sermons archive, well actually it's a page, looks pretty good.
hidden link

Author archive, for instance hidden link , has a couple of issues. The styling is something I can fix easily enough. But since rgales is author of 1 'person' and several 'sermons' I thought I'd get the 'person' post, followed by the sermons, in the archive, and that isn't working at this time. Not sure what to add to that layout to make it work.

Persons archive has the opposite problem, it's showing the person information but not the sermons for that person.

In addition I need to suppress parts of the output when certain fields are empty or there are no sermons by that person/author...

So I'm still a little bit away from where I need to be but getting closer.

#462294

Hi, Nigel,
I think I figured out what I want for the author archives and I hope you will tell me how to do it.
I have worked extensively on the single person display. A sample:
hidden link
What I need is for the author page to look exactly like this. It strikes me that we could just redirect the author page to the person page and we'd be done with this part, plus there would only be one section to change if we wanted to vary the look.
So, please let me know how I might do such a redirect.

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.