• Resolved natael

    (@natael)


    Hi,

    Not sure how to do it best.
    I would like to display, either on a sidebar, or on a page, the Nasa picture of the day (but not on a post, I’d like it to be always visible on top of things). The latter would be automatically updated each day.
    I can’t find (yet) a dedicated plugin for that. Is there a way that do not require much coding to do that ?

    The Nasa picture of the day can be seen there :
    https://www.nasa.gov/multimedia/imagegallery/iotd.html

    My blog is there (it’s in french):
    https://www.lyrimages.fr

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter natael

    (@natael)

    i noticed a possibility to make a wordpress post from their site, but this is not what i’m looking for. I don’t want just a link, but the actual picture.
    Just to clarify.

    Thanks

    Grab the feed and extract the image from the feed.
    https://www.nasa.gov/rss/image_of_the_day.rss

    Assuming you can manage adding code ok, plonk this in whichever template file of your theme you want it to show up in.

    <?php
    $rss = fetch_feed( 'https://www.nasa.gov/rss/image_of_the_day.rss' );
    if( !is_wp_error( $rss ) ) {
    	$rss = $rss->get_image_url();
    	echo '<img src="' . esc_url( $rss ) . '" />';
    }
    ?>

    That should get you started… ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display Nasa picture of the day ?’ is closed to new replies.