Ben en son kontrol çalışıyor ve yana durduğu, bir WP tema üzerinde çalışıyorum. Belki küçük bir şey ama şu anda fındık beni sürüyor.
Ben youtube kullanıcı adı alarak ve son video kapma ve sayfanın içine gömmek ediyorum. Oldukça basit gibi görünüyor, ama ben yanlış atak olabilir.
İşte benim kodu (herhangi bir öneriniz?) Olduğunu:
<?php // Get YOUTUBE FEED
include_once(ABSPATH . WPINC . '/feed.php');
// Get a SimplePie feed object from the specified feed source. - YOUTUBE FEED ADDRESS
$youtube = fetch_feed('http://gdata.youtube.com/feeds/api/users/USERNAME/uploads');
if (!is_wp_error( $youtube ) ) { // Checks that the object is created correctly
// Figure out how many total items there are, but limit it to 1.
$maxitemsy = $youtube->get_item_quantity(1);
// Build an array of all the items, starting with element 0 (first element).
$rss_itemsy = $youtube->get_items(0, $maxitemsy);
}
?>
<h3>YouTube</h3>
<ul>
<?php if ($maxitemsy == 0) echo '<li>No Video? Check out our <a href="http://www.youtube.com/USERNAME" >YouTube Channel</a></li>';
else
// Loop through each feed item and display each item as a hyperlink.
foreach ( $rss_itemsy as $item ) {
$link = $item->get_item_tags('http://search.yahoo.com/mrss/', 'player');
$useThis = $link[0]['attribs']['']['url'];
?>
<li>
<object style="height: 172.5px; width: 230px">
<param name="movie" value="http://www.youtube.com/v/<?php echo getYTid($useThis);?>">
<param name="allowFullScreen" value="true">
<param name="allowScriptAccess" value="always">
<embed src="http://www.youtube.com/v/<?php echo getYTid($useThis);?>" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="230" height="172.5">
</object>
</li>
<li>
<?php echo $item->get_content();?>
</li>
<?php } ?>
</ul>
Her neyse, ben çıkış yerine (öncesine kadar gösteren) youtube embed "Bizim ... check out, hiçbir videoyu" elde tutmak.
Yardım!