Solved

wordpress bloginfo language

Posted on 2014-09-04
6
351 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

In Part I (http://www.experts-exchange.com/Web_Development/Blogs/WordPress/A_8410-Getting-Started-In-WordPress-Part-I.html), I introduced you to the powerful WordPress backend, the WordPress administrative Dashboard.  In Part II, I will introduce yo…
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 integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

828 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