Skip Navigation

[Resolved] Divi theme and taxonomies archive pages

This support ticket is created 4 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

This topic contains 9 replies, has 2 voices.

Last updated by urkoP 4 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#1261727
Captura de pantalla 2019-06-07 a las 1.40.17.png

Hello,

I'm making a website for a photo file gordegia.eus. Each photo has different taxonomies and I am working with DIvi.

I have a problem when designing archive for taxonomy files. I can not do it in a toolset view, because they are going to upload more and more photos and creating new terms for each taxonomy. do not?

What I have done is duplicate the index.php file of divi rename it as taxonomy.php and place it in divi-child. Then from "edit content templates" of toolset edit these taxonomy to taxonomy. I want them to go in bootstrap grid to four, as I did in an other view.

But the result is the divi template to list files and four photos per result.

I am not very proficient with the code and I am trying to change it in the taxonomy.php but I do not succeed.

the page is under construction to take a look:
username: GordEgia
Password: EgiaGorde12

Could you help me out? Thanks

#1261931

Nigel
Supporter

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

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

Hi there

I'll try and help, but I need to understand the problem first.

Each photo has different taxonomies... ...they are going to upload more and more photos and creating new terms for each taxonomy

I don't understand this.

It sounds as if you are creating unique terms for every photo.

But taxonomies are for grouping similar things. So in photography you could have a "dominant colour" taxonomy with terms "red, orange, yellow, blue, green" etc., so that you have a bunch of photos tagged with red as the dominant colour, others with green as the dominant colour, and so on.

The taxonomy archive at site.com/dominant-colour/red/ would then show all of the photo posts tagged with red as the dominant colour.

I'm sure you know this.

But I don't understand what you are doing differently that means you cannot use normal taxonomy archives.

#1262165

Hi Nigel,

What I mean with the taxonomies is that the terms are not predetermined, that is, there is not a color where the choice is between red, green and yellow. Each one will enter the terms you want, purple, turquoise, blue, sky blue, dark blue, ... therefore you can create an infinite number of terms for each taxonomy.

The point is that the file where the taxonomy terms are listed works well. That is, if I click on a term of the author taxonomy, for example John, I visualize all the photos with the term John for the author taxonomy. The result of the query is correct. But the results are seen on the Divi results template and I can not make my own template to visualize them in the front-end.

I have tried in different ways and I do not get it:

I have tried from the toolset menu in the option> content template> use for taxonomy files.

I have tried the same thing but creating a file in my son son taxonomy.php and neither ...

In the end yesterday I realized that you can go through and pick parameters by url for views. And the solution works.

I have created a page where I include a view by taxonomy. And this view collects parameters by url. It is a valid option. But the other way it seemed simpler.

Now with this solution that I have searched, for example, another problem has arisen. In the category keywords the terms are separated by comma in the fields. Keywords: street, school, workshop, ...

To visualize these I make the call {! {Wpv-post-taxonomy type = "photos_keywords"}!} But the links take me to the results page of divi taxonomy terms, which is what I do not want to see, because I can not customize it. Then I would have to add to each term of taxonomy parameters by hand <a href = "hidden link type =" photos_keywords "format =" slug "]" > so that later they are collected in the "keywords" page where I insert the view that collects these parameters. But this I do not know how to do it.

Thank you.

#1262197

Nigel
Supporter

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

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

Have you tried to make a custom archive for the taxonomy at Toolset > WordPress Archives?

It is much like creating a View, but is displayed at the normal archive URL, and you can design the output with Divi if you like.

https://toolset.com/documentation/getting-started-with-toolset/customize-post-archives/

#1262221
Captura de pantalla 2019-06-07 a las 12.40.10.png
Captura de pantalla 2019-06-07 a las 12.38.08.png

I think I've done it well but it does not work for me. I do not know if it's because I'm working on media and not on a cpt. The point is that the project requires it that way since the photos are entered into the gallery already with the metadata that WordPress automatically collects later.

In fact what I have seen was that there is an option to create a taxonomy template to taxonomy and it does not work either. And it should be something similar, right?

#1262343
Captura de pantalla 2019-06-07 a las 14.03.27.png

I tried again but the result is that of the photo.
And this is the code that I'm putting into the wordpress file in the loop

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="4" pad="true">
[wpv-item index=1]
<div class="row ">
<div class="col-sm-3">
<div class="kontainerra"><img class="argazkiarena" src="[get_att_src att_id='[wpv-post-id]' att_size='full']">
<div class="bestebat">
<div class="bestebi"><span><a href="[wpv-post-url]">[wpv-post-title]</a></span>
<br>
<small><a href="hidden link type="photos_creator" format="slug"]">[wpv-post-taxonomy type="photos_creator" format="name"]</a></small>
</div>
</div>
</div>
</div>

[wpv-item index=other]
<div class="col-sm-3">
<div class="kontainerra"><img class="argazkiarena" src="[get_att_src att_id='[wpv-post-id]' att_size='full']">
<div class="bestebat">
<div class="bestebi"><span><a href="[wpv-post-url]">[wpv-post-title]</a></span>
<br>
<small><a href="hidden link type="photos_creator" format="slug"]">[wpv-post-taxonomy type="photos_creator" format="name"]</a></small>
</div>
</div>
</div>
</div>
[wpv-item index=4]
<div class="col-sm-3">
<div class="kontainerra"><img class="argazkiarena" src="[get_att_src att_id='[wpv-post-id]' att_size='full']">
<div class="bestebat">
<div class="bestebi"><span><a href="[wpv-post-url]">[wpv-post-title]</a></span>
<br>
<small><a href="hidden link type="photos_creator" format="slug"]">[wpv-post-taxonomy type="photos_creator" format="name"]</a></small>
</div>
</div>
</div>

</div>
</div>
[wpv-item index=pad]
<div class="col-sm-3"></div>
[wpv-item index=pad-last]
<div class="col-sm-3"></div>
</div>
</wpv-loop>
[wpv-pager-nav-links output="bootstrap" previous_next_links="true" step="10" reach="2" text_for_previous_link="Aurrekoa" text_for_next_link="Hurrengoa"]
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

#1262365

Nigel
Supporter

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

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

OK, so we are not looking at standard posts, we are looking at media posts.

If you assign a custom taxonomy to media then when editing images in the media library then you can add terms to the images.

If you then go to Toolset > WordPress Archives you can create a custom archive for the taxonomy, which will include media posts in the output.

In the output section of the custom archive you can use shortcodes such as wpv-post-title to output the title, wpv-post-id to output the media post id which could be useful, and if you output the post content with the wpv-post-body shortcode then it will output the image itself.

I just tried that on my own test site, visiting site.com/colour/red/ and it output media tagged with "red" in the custom "colour" taxonomy.

I wasn't using Divi, but you should get the same result if you do.

#1262377

In any case, although it may not be the best way to do it. I have solved it with the views and passing the parameters by url. But only in the case where there is a term.

As I said before when in the field of taxonomy there are more than one, for example, KEY WORDS: work, street, school, ...

I make the call {! {Wpv-post-taxonomy type = "photos_keywords"}!}. All the terms separated by comma and with link are listed, but these link to the DIVI template.

How can I assign to each term the link of the route of the page and the parameters to pass?

In the case of taxonomies that only have one term, such as date. It's simple, I do:

<a href="hidden link type="photos_data" format="slug"]"> [wpv-post-taxonomy type = "photos_data" format = "name"] </a>

But when there is more than one term separated by comma in the field, can it be done? how to do it?

Thanks!

#1262391

Nigel
Supporter

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

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

A better solution is to use archives, when the links would all be automatically generated correctly.

For your solution with bespoke URLs that use URL parameters you will need to create a custom shortcode (https://developer.wordpress.org/plugins/shortcodes/) to generate the links.

The wpv-for-each shortcode (https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-for-each) can iterate over multiple entries for fields, but is for custom fields only, you can't use it to iterate over taxonomy terms.

#1264393

My issue is resolved now. Thank you!

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