Solved

wordpress bloginfo language

Posted on 2014-09-04
6
340 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
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…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now