Skip Navigation

[Resolved] Google Ads snippet is not rendered when I reload the page with params

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.

Our next available supporter will start replying to tickets in about 0.65 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by umbertoZ 1 year, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#2509397

Thank you Luo, now the map works fine.

I could also rebuild the gallery, but I had the problem that the <img> tag was not redered with this shortcode:

[types termmeta='taxonomy-gallery' title='%%TITLE%%' alt='%%ALT%%' size='full' index='0'][/types] 

But I found that the image URL was correctly rendered in this way:

[types termmeta='taxonomy-gallery' size='full' index='0' url='true'][/types]

So I built the <img> tag by myself in this way (I've to add a custom shortcode to get the image ALT):

<img src="[types termmeta='taxonomy-gallery' size='full' index='0' url='true'][/types]" alt="[img-alt img_url='[types termmeta='taxonomy-gallery' size='full' index='0' url='true'][/types]']">

I still have an issue, I've a custom term field where I store a Google Ads snippet, it is still not rendered when I reload the page with params. But it appers correcly without params. This is my code in the Output Editor (line 26):

  <div class="div-ads">
    <div class="div-ads-title">Advertisement</div>
    [types termmeta='advertising-code'][/types]
  </div>

cheers

#2509423

Hello,

In the taxonomy archive page, you can display the current term information, like this:
1) Create a taxonomy view:
hidden link
- Query terms of taxonomy "Destinations"
- Filter by:
Taxonomy is set by the page where this View is inserted
- In view's loop, display term information:
[types termmeta='advertising-code' output='raw'][/types]

2) Edit the WordPress Archive:
hidden link
in section "Output Editor", line 28, display above taxonomy view shortcode:
[wpv-view name="current-term-information"]

Test it in frontend:
hidden link
It works fine

#2510355

Hi Luo, the solution works fine, the only issue I still have is that I'm using the same archive for different taxonomies, so I've to create a different Taxonomy View for each one of them.

There are 6 taxonomies, I would like to not load 6 views at the same time in the archive, to prevent 6 calls to the database, even if 5 of them will return an empty result.

So I thought to use a conditional to check the current taxonomy Single name and display the correct Taxonomy View. I tried with [wpv-taxonomy-archive info="taxonomy"], but the output is empty.

Any suggestion?

I know I could create a different archive for each taxonomy. But i would prefer to work with only one archive.

cheers

New threads created by Luo Yang and linked to this one are listed below:

https://toolset.com/forums/topic/check-the-current-taxonomy-single-name-and-display-the-correct-taxonomy-view/

#2510879

For the new shortcode [wpv-taxonomy-archive] question, please check the new thread here:
https://toolset.com/forums/topic/check-the-current-taxonomy-single-name-and-display-the-correct-taxonomy-view/

#2514579

My issue is resolved now. Thank you!