Forums

Add the wp-forecast into a post/page? (4 posts)

  1. crz
    Member
    Posted 2 years ago #

    Hello,

    First of all I must say that I love this plugin, great work!

    My question is.. how could I add the forecast for several days into a post/page? I'd like to keep the sidebar widget short and clean with some general information (that's done) and a more detailed forecast in a specific post.

    Any help would be highly appreciated. Thanks!

    Mike

  2. Samuel B
    moderator
    Posted 2 years ago #

    from developer:

    manually edit your template
       file and put the wp-forecast function where you want your weather
       data to show up.
       Example:
    
    <ul>
    <li>
                     <?php if(function_exists(wp_forecast)) {
                       wp_forecast( <widget_id> );
                     } ?>
                 </li>
    </ul>
    
         You have to replace <widget\_id> with the choosen widget id.
         For the first widget use wp\_forecast("A"), for the second
         wp\_forecast("B") and so on.
         In most cases it is advisable to put the call into a div environment.
  3. crz
    Member
    Posted 2 years ago #

    Thank you

  4. tuxlog
    Member
    Posted 2 years ago #

    hello crz,
    from version 2.4 on there is a shortcode built into wp-forecast.
    you can just put [wpforecast id="A"] in your post and the widget is displayed in an iframe not slowing down the rest of the post.

    cheers
    hans

Topic Closed

This topic has been closed to new replies.

About this Topic