Solved

wordpress bloginfo language

Posted on 2014-09-04
6
338 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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 set up the permalinks on a WordPress Website. 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 : Go t…

760 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

21 Experts available now in Live!

Get 1:1 Help Now