Skip Navigation

[Resolved] user_is_author='true' does not work on a translated page of author archive

This support ticket is created 7 years, 8 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)

This topic contains 18 replies, has 2 voices.

Last updated by kevinH-3 7 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#486213

Hi,

I use WPML and Toolset. [types usermeta='avatar' user_is_author='true' output='raw'][/types] works on:

<em><u>hidden link</u></em>

but does not work on:

<em><u>hidden link</u></em>

Instead of the previous code, the following code works in all languages. The problem is that it does not work as a condition in [wpv-conditional]
[types usermeta='avatar' output='raw' user_id="[wpv-post-author format='meta' meta='ID']"][/types]

I can give you access to my site if needed.

Thank you.

#486239

Nigel
Supporter

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

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

Hi Kevin

I tried to reproduce the problem on a test site but was unable to.

My default site language is English, and I have Spanish as an additional language.

I created a custom User field.

I created a custom WordPress archive for the author archives, and I output the custom User field on that archive, using

[types usermeta='team' user_is_author='true'][/types]

I visited site.com/author/my-name and site.com/es/author/my-name and the custom user field was output in both cases.

I don't see any debug info for your site (https://toolset.com/faq/provide-debug-information-faster-support/).

Can you confirm which versions of WordPress, Types, and WPML you are using?

#486273

Hi Nigel,

Thank you for your help.

[edit]

#486293

Nigel
Supporter

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

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

Hi Kevin

You appear to be using the same—current—versions as I used on my test.

Can you describe your language settings (WP installation language, WPML default and additional languages)?

Also, where and how you are trying to output the Types user fields? (Editing a Views custom archive, or directly editing the PHP template for author archives?)

#486300
screen2.png
screen.png

Nigel,

I transferred you two screenshots. I can also give you access to the backend.

I have edited a "Content template" in Author Archive layout :

[wpv-conditional if="( '[types usermeta='avatar' user_is_author='true' output='raw'][/types]' ne '' ) "]
[types class="img-circle img-avatar border-white marg-b-15" usermeta='avatar' alt='[wpv-post-author]' title='[wpv-post-author]' size='large' align='none' resize='proportional' user_is_author='true'][/types]
[/wpv-conditional]

[wpv-conditional if="( '[types usermeta='avatar' user_is_author='true' output='raw'][/types]' eq '' )"]
<img class="img-circle img-avatar border-white marg-b-15" src="[wpv-bloginfo show='stylesheet_directory']/images/avatar.png">
[/wpv-conditional]

Thank you for your help.

#486303

I can give you access to my site if needed. 😉

#486416

Nigel
Supporter

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

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

Hi Kevin

Can I go ahead and get credentials for you, it sounds like you are using Layouts, and I just want to see your layout design for the author archives.

I will mark your next reply as private where you can enter log-in credentials—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site, even though I don't intend to make any changes.

#486424

Nigel,

Thank you for your help.

My post was not set privately. Can I send you the identifiers by email?

#486590

Nigel
Supporter

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

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

Sorry Kevin

Let me try again.

#486667

Nigel
Supporter

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

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

Hi Kevin

I can see the problem on your site but am having problems reproducing it with a similar set up on my test site, so I'm going to take a copy of your site to test locally where I can make changes without fear of breaking anything.

I'm doing that now and I'll keep you posted.

#486697

Great ! Thanks Nigel!

#487042

Nigel
Supporter

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

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

Hi Kevin

I found this particularly difficult and time consuming to track down. I had appeared to identify the problem as being that it was only possible to reproduce the issue when the WordPress installation was non-English, but when I came to report this as a bug in an internal ticket it was only when describing the steps required to reproduce the problem that it occurred to me the explanation is actually very simple.

Your content is in French and you haven't translated it to English.

When you visit the author archive in French there are matching posts, but when you visit it in English there is no matching content (which means there is no global $post object which is what the types shortcode requires to retrieve the user meta for the author).

If you translate some of the content, even if just one post for each author, then you should find your types user meta shortcodes work.

#487066

Hi Nigel,

Thank you for the time you spent. Normally, content should be displayed in English when there is no English content.

I have the impression that it is not possible to translate, with WPML, the custom user meta. Can you confirm it to me ?

Thank you !

#487072

Nigel
Supporter

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

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

That's correct, Kevin, I checked throughout the settings and while you can translate post meta and taxonomy meta, you cannot translate user meta.

That should perhaps be a feature request, but I think it is a request you would need to make in the WPML forums rather than here.

#487084

Thank you Nigel !

I'll see what I can do.

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