adding youtube to custom homepage on wp-nelo

I would like to replace the intro image on wp nelo with a youtube video how can this be done?

  • Mason

    Hiya,

    To do this will require creating a child theme of WP-Nelo. You can read about child themes here:
    http://wpengineer.com/2045/understand-wordpress-child-theme/

    We include a sample child themes by default right in the theme download.

    In that child theme you'll need to call your own copy of wpmu-nelo-chid/lib/templates/wp-template/custom-homepage.php

    Just make a copy of the file from the parent theme and paste it into the same directory structure (you'll have to create the folders in the chid theme).

    Open the newly copied custom-homepage.php and look at lines 63-71. That is the code for the custom image area. Just remove these lines and replace them with the embed URL for the video you want to use and save the file.

    Make sure you activate the child theme to see the changes.

  • positively network

    Thanks for that. following code just brings up a link that doesn't go anywhere.

    <?php } elseif ($tn_wpmu_latest_post == "custom post") { ?>
    
    <a href="<?php echo stripslashes($tn_wpmu_intro_header_imgurl); ?>">
    <?php if(file_exists($upload_path . 'intro_normal.jpg')) { ?>
    <img src="<?php echo "$ttpl_path/intro_normal.jpg"; ?>" alt="intro" />
    <?php } else if(file_exists($upload_path . 'intro_crop.jpg')) {?>
    <iframe width="560" height="315" src="http://www.youtube.com/embed/H96ysymkAGc" frameborder="0" allowfullscreen></iframe>
    <a href="<?php echo stripslashes( $tn_wpmu_intro_header_imgurl ); ?>"><?php echo stripslashes( $tn_wpmu_intro_header ); ?></a>
    <?php } ?>
    </h2>
    <?php if($tn_wpmu_intro_text == '') { ?>
    <?php _e('You can replace ever area on this page with a new text in <a href="wp-admin/themes.php?page=custom-homepage.php">your theme options</a> or <a href="wp-admin/themes.php?page=custom-homepage.php">upload and crop new images</a> to replace the ones you can see here already.', 'nelo'); ?>
    <?php } else { ?>
    <p><?php echo stripslashes( $tn_wpmu_intro_text ); ?></p>
    <?php } ?>

    How

  • Mason

    Hiya,

    Try selecting the "old embed" method vs using the iframe method.

    The code you provided above should look like this:

    <?php } elseif ($tn_wpmu_latest_post == "custom post") { ?>
    
    <object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/H96ysymkAGc?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/H96ysymkAGc?version=3&hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>
    <h2>
    <?php if($tn_wpmu_intro_header == '') { ?>
    This is intro header
    <?php } else { ?>
    <a href="<?php echo stripslashes( $tn_wpmu_intro_header_imgurl ); ?>"><?php echo stripslashes( $tn_wpmu_intro_header ); ?></a>
    <?php } ?>
    </h2>
    <?php if($tn_wpmu_intro_text == '') { ?>
    <?php _e('You can replace ever area on this page with a new text in <a href="wp-admin/themes.php?page=custom-homepage.php">your theme options</a> or <a href="wp-admin/themes.php?page=custom-homepage.php">upload and crop new images</a> to replace the ones you can see here already.', 'nelo'); ?>
    <?php } else { ?>
    <p><?php echo stripslashes( $tn_wpmu_intro_text ); ?></p>
    <?php } ?>

    See how I have an object in there and the default lines from 63-71 have been removed? That's what we're going for. I used the same video you had in your code so the above should do the trick for ya.

    Let us know. Thanks!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.