-
AuthorPosts
-
December 19, 2020 at 11:39 pm #1268694
Hi, i need to vary the language + link of the privacy policy link in my socket for Dutch / English. How do I do that so that on pages in Dutch the Dutch socket is displayed and on pages in English the Englisch socket is displayed?
Many Thanks
December 21, 2020 at 12:38 pm #1269003Hey Alexander2021,
To do this please create both links in your socket copyright field, and add a custom class to each link like this:
<a class="nl" href="/privacyverklaring/">Privacy Verklaring</a><a class="en" href="/en/privacy-policy/">Privacy Policy</a>
Then we will use this css to hide the links individually based on language:html[lang="en-GB"] #socket .nl {display: none;} html[lang="nl-NL"] #socket .en {display: none;}
Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field.
After applying the css, please clear your browser cache and check.Best regards,
MikeDecember 21, 2020 at 3:30 pm #1269049Okay,
A problems occurred when i change the copyright info (socket) via theme options: all of a sudden my images are gone from the header and from the slider on the front page.when I empty the copyright info the images do not re-appear. So there is a bug.
I experienced this several other times when editing the socket / copyright info on my site and there was no undo; i had to restore from back up
please check, use temporary login in private content
December 21, 2020 at 3:34 pm #1269051in addition: all content seems to have disappeared from the home pages, both NL and UK
December 21, 2020 at 3:42 pm #1269053to have the shortcode option on polylang first add this to your child-theme functions.php:
function polylang_shortcode($atts, $content = null){ if (empty($content)) return ''; extract( shortcode_atts( array('lang' => ''), $atts ) ); if (empty($lang)) return "<h3>You must specify 'lang' using shortcode: polylang</h3>"; return ($lang == pll_current_language()) ? $content : ''; } add_shortcode('polylang', 'polylang_shortcode');
after that you can insert this :
[polylang lang="en"]english content[/polylang][polylang lang="de"]deutscher Inhalt[/polylang][polylang lang="nl"]Nederlandse inhoud[/polylang]
December 21, 2020 at 3:56 pm #1269059@Guenni007: the class option that Mike suggested worked fine. It is just that something happens to the visibility of the content after editing the copyright / socket via theme opions
December 21, 2020 at 5:48 pm #1269101This reply has been marked as private.December 21, 2020 at 5:50 pm #1269102did you try my solution?
that in copyright field
[polylang lang="en"]<a href="/en/privacy-policy/">Privacy Policy</a>[/polylang][polylang lang="nl"]<a href="/privacyverklaring/">Privacy Verklaring</a>[/polylang]
with that snippet mentioned above in child-theme functions.php
function polylang_shortcode($atts, $content = null){ if (empty($content)) return ''; extract( shortcode_atts( array('lang' => ''), $atts ) ); if (empty($lang)) return "<h3>You must specify 'lang' using shortcode: polylang</h3>"; return ($lang == pll_current_language()) ? $content : ''; } add_shortcode('polylang', 'polylang_shortcode');
December 21, 2020 at 6:27 pm #1269106@guenni007: yes I tried that as well; same problem :-(
December 22, 2020 at 1:10 pm #1269304and you are shure that you are not affected by this: https://kriesi.at/support/topic/problems-after-updating-to-wordpress-5-6-read-this-first/
December 22, 2020 at 1:24 pm #1269310Hi, I tried that, but no changes :-(
December 22, 2020 at 2:23 pm #1269320Hi,
@Guenni007 thank you for pointing out this solution, and the jQuery Migrate issue.
@Alexander2021 thanks for posting a login token by it didn’t work for me. Anyways, I see this error in the browser console:
Uncaught SyntaxError: Unexpected token '!' >> siteground-optimizer-combined-js-cb7bf8c77e4408bb1dc8aa56163b4b79.js:77
Please disable all caching and check again, but you may also want to try the jQuery Migrate solution @Guenni007 linked to above.
I’m glad to hear that you liked the solution I posted, but you may find @Guenni007’s solution better because you can easily wrap any text with the shortcode to hide based on language,[polylang lang="en"]...[/polylang]
, just a suggestion.Best regards,
MikeDecember 22, 2020 at 2:57 pm #1269327Hi Mike,
I tried switching off caching & also tried the other solution (jQuery Migrate plugin), but nothing works.
Can I retry sending you a login token so you can have a look inside?
Can you provide me with an email adress i can use for generating this token?Thanks, Alexander
- This reply was modified 3 years, 11 months ago by Alexander2021.
December 23, 2020 at 1:02 am #1269413Did you pay attention of the jQuery Migrate Plugin settings: load 1.12.4 legacy jQuery
December 23, 2020 at 1:55 pm #1269533Hi,
Thank you I found that the login token is now working so I checked your site and disabled your Enfold Theme Options > Performance > JS & CSS file merging and compression and enabled your Enfold Theme Options > Performance > Delete old CSS and JS files, and this seems to have solved the issue, please clear your browser cache and check.Best regards,
MikeDecember 23, 2020 at 2:40 pm #1269544Hi Mike,
Many thanks, that works!
Do you know the cause? Could it be the use of the siteground optimiser plugin?
Alexander
December 23, 2020 at 3:40 pm #1269554Hi,
I believe that the “stacking” of caching & minifying, along the line developed an error, you can try activating them again and they will most likely work correctly, but I would recommend to only do so when you are done building the site. Or at least do a complete cache purge in the theme settings and your plugins, and in your browser, after major edits. 👍
Unless there is anything else we can assist with on this issue, shall we close this then?Best regards,
MikeDecember 23, 2020 at 4:06 pm #1269562Hi Mike,
Yes, this item can be closed :-)
Thanks, AlexDecember 24, 2020 at 12:36 am #1269688Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘polylang in socket’ is closed to new replies.