How do I pull weather widget outside WP?

Posted in: Newspaper
Post count: 69

Hi

I can pull the Newspaper top menu using

$args = array( 'menu' => '2797' );
wp_nav_menu( $args );

This works great but it is missing the date and the weather widget.

I have something close to the date using:

echo date_i18n( get_option( 'date_format' ), strtotime( '11/15-1976' ) );

But it is missing the day in front of the month, date, year format.

Now I’m trying to pull the weather widget. What code can I use? How is it pulled in that top menu?

I’m doing this so that external pages of the site match the Newspaper look. Thank you !

http://www.tuxreports vs. http://www.tuxreports.com/community

Post count: 69

The way to pull the date:

echo date_i18n( 'l, F jS, Y', strtotime( '11/15-1976' ) );

Now I just need to figure out how to grab that weather widget in the top menu.

Well, CSS is still not good but coming along.

Post count: 22421

Hi,

Here is the function used to render the weather on the top menu: http://screencast.com/t/6MRX5RyO4R and below that: http://screencast.com/t/LjZXCSunbsHI

Thank you!

Post count: 69

Thank you !

Post count: 69

Minor issue: the access modifier is missing in the static function render_generic. Regardless, I’m not able to pull that information properly.

td_weather::render_generic();

This leads to three missing parameters.

And FWIW, the render_top_bar_template is a private function.

Oh well, it was worth a try. 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.