• ignitionmedia

    (@ignitionmedia)


    Hi there,
    I dont quite understand how to use the custom feilds but am pretty sure its what I need to do what I want to do.

    I have the one template but I want it to show different weather/images etc in the sidebar depending on the page (not post) that they are on.

    Could I add the code for a weather plugin to the sidebar and add the above code where the weather ID goes (then add the weather ID as the value of the custom field for that page setting). eg

    I am using

    <?php if(function_exists(wp_forecast)) {
    wp_forecast( “<?php $key_name = get_post_custom_values($key = ‘weather’); echo $key_name[0]; ?>” );
    } ?>

    and on my page I have added a Key called “weather” and given it the value of “A” which should return this code:

    <?php if(function_exists(wp_forecast)) {
    wp_forecast( “A” );
    } ?>

    However this does not seem to work as the weather area returns “Sorry, no valid weather data available.” instead of showing the weather for A

    Any help at all would be appreciated!!!

    thanks

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Question about get_post_custom_values in template’ is closed to new replies.