Wordpress:如何在数组中包含自定义字段(SmplePie)
Wordpress 2.8.4,简单饼图插件2.2.1 我有这个:Wordpress:如何在数组中包含自定义字段(SmplePie),wordpress,rss,simplepie,Wordpress,Rss,Simplepie,Wordpress 2.8.4,简单饼图插件2.2.1 我有这个: <?php echo SimplePieWP( array( 'http://gdata.youtube.com/feeds/base/videos?q=fifa10%20trailer&client=ytapi-youtube-search&alt=rss&v=2' ), array( 'items' => '1') ); ?> 我不希望使用fifa10而是希望使用自
<?php echo SimplePieWP(
array(
'http://gdata.youtube.com/feeds/base/videos?q=fifa10%20trailer&client=ytapi-youtube-search&alt=rss&v=2'
),
array(
'items' => '1')
); ?>
我不希望使用fifa10
而是希望使用自定义字段的值,其中的键为name of game
如何执行此操作?您可以通过以下方式获取Wordpress自定义字段的值: 要将其包含在对SimpleView的函数调用中,请使用字符串连接和
(点):
get_post_meta($post->ID, 'name-of-game', true)
<?php echo SimplePieWP(array('http://gdata.youtube.com/feeds/base/videos?q=' .
get_post_meta($post->ID, 'name-of-game', true) .
'%20trailer&client=ytapi-youtube-search&alt=rss&v=2'),array('items' => '1')); ?>