Jump to content


Photo
- - - - -

Can't add weather widget


Best Answer Rob , 04 January 2013 - 05:02 AM

I don't think you can add that code in a box.

 

Rather, I think you can add it to a box created by the WP Boxer plugin, since that uses Content Blocks in place of boxes (which are custom post types).

 

There may be different ways to approach this too. Most of the Google Translate code can be placed, essentially in Dashboard > PageLines > Site Options > Custom Code in the Headerscripts area. The last bit,

 

 
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

 

Can be placed in the content block in HTML mode.

Go to the full post


  • Please log in to reply
7 replies to this topic

#1 welcome

welcome

    Advanced Member

  • Members

  • 87 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 02 January 2013 - 02:34 PM

Hi,

I am trying to add a weather widget inside a box, but am unable to.  I notice that since an upgrade the tab is listed as "text" whereas before it was "HTML" I believe.  Does this have something to do with it?

 

What I have attempted to do is copy and past the snippet into the box under text.  In the past i was able to add google maps, this way.

Thanks


  • ximmerra likes this

#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 02 January 2013 - 03:11 PM

What code does this weather widget require?



#3 welcome

welcome

    Advanced Member

  • Members

  • 87 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 02 January 2013 - 03:48 PM

I tried one from weather.com. I also tried adding google translate to my site. One was a script, one started with div. Thanks

#4 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 02 January 2013 - 03:59 PM

Can you please paste the code for the Weather widget here?



#5 welcome

welcome

    Advanced Member

  • Members

  • 87 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 02 January 2013 - 05:58 PM

Hi 

This is for google translate

 

<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, gaTrack: true, gaId: 'UA-28091179-2'}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
        
This for weather
<script type="text/javascript" src="

Please Login or Register to see this Hidden Content

"></script>


#6 welcome

welcome

    Advanced Member

  • Members

  • 87 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 03 January 2013 - 10:15 PM

HI,

Any follow up on my questions?

Thanks



#7 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 04 January 2013 - 05:00 AM

Hi there, I've pasted the weather widget into a page and it's displaying, but its all over the place. The html view has been relabeled text but it will still be the same as before. I think the problem is that wordpress 3.5 had a massive jquery update and this script doesn't seem to be performing as it should inside. You might need to check with the source of the code.

 

The google translate code would have to be added as a hook, you could do this using the hooker plugin

Please Login or Register to see this Hidden Content

all you would do is select the required location from the drop down and then insert the code.



#8 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 04 January 2013 - 05:02 AM   Best Answer

I don't think you can add that code in a box.

 

Rather, I think you can add it to a box created by the WP Boxer plugin, since that uses Content Blocks in place of boxes (which are custom post types).

 

There may be different ways to approach this too. Most of the Google Translate code can be placed, essentially in Dashboard > PageLines > Site Options > Custom Code in the Headerscripts area. The last bit,

 

Please Login or Register to see this Hidden Content

 

Can be placed in the content block in HTML mode.