Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

wordpress bloginfo language

Posted on 2014-09-04
6
Medium Priority
?
373 Views
Last Modified: 2014-09-04
Hello Experts,

I am using the Responsive Facebook plugin for WordPress.

I could not find any help with how to set the language of the widget output.

This is the plugin URL: https://wordpress.org/plugins/responsive-facebook/

Below is the code taken from the plugin script. This is the place where I could change the "js.src" to "de_DE".

Now I need to set the language according to the blog language (english/german).

I tried the get_bloginfo('language'); but it is inside of a javascript not PHP. Can someone help with / guide me on how to pass the blog language set to this function and then change the language accordingly? Thank you!

<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0"; 
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

Open in new window

0
Comment
Question by:Refael
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 14

Expert Comment

by:Brad Groux
ID: 40303621
It seems like you're missing an HTTP:

What you have:
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0"; 

Open in new window

What it should be:
js.src = "http://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0"; 

Open in new window

What you need:
js.src = "http://connect.facebook.net/de_DE/sdk.js#xfbml=1&version=v2.0"; 

Open in new window

0
 
LVL 82

Expert Comment

by:leakim971
ID: 40303686
Why not asking the question to the coder itself, see the FAQ page : https://wordpress.org/plugins/responsive-facebook/faq/
0
 

Author Comment

by:Refael
ID: 40303728
leakim971 , Brad Groux

All i want is to echo the language to the URL look below. Since this is not working! Is there another way?

//connect.facebook.net/<?php get_bloginfo('language');?>/sdk.js#xfbml=1&version=v2.0

Open in new window

0
Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 40303747
you miss the echo :
//connect.facebook.net/<?php echo get_bloginfo('language'); ?>/sdk.js#xfbml=1&version=v2.0
0
 

Author Closing Comment

by:Refael
ID: 40304033
Always thank you leakim971 !!!

This is how is loved it:

js.src = "//connect.facebook.net/<?php if(get_bloginfo('language') == "de-DE"){echo "de_DE";}else {echo "en_US";};?>/sdk.js#xfbml=1&version=v2.0";
0
 
LVL 82

Expert Comment

by:leakim971
ID: 40304039
;-))
0

Featured Post

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question