Solved

wordpress bloginfo language

Posted on 2014-09-04
6
362 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 82

Accepted Solution

by:
leakim971 earned 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
Suggested Courses

627 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