Php WORDPRESS:在主页中插入SWF而不是post

Php WORDPRESS:在主页中插入SWF而不是post,php,wordpress,actionscript-3,flash,wordpress-theming,Php,Wordpress,Actionscript 3,Flash,Wordpress Theming,我有wordpress flash游戏网站。在管理面板中,我在这里添加或编辑帖子,我有一个名为Swf URL的字段:我在这里添加Swf链接,它链接到显示flash游戏的帖子。我想做同样的事情,但不是在帖子中,我想使用这个功能(在swf的帮助下添加游戏)到主页 现在情况如何: 我多么想看到: 功能代码: load_theme_textdomain( "freebabyhazelgames", TEMPLATEPATH."/languages" ); $locale = get_locale(

我有wordpress flash游戏网站。在管理面板中,我在这里添加或编辑帖子,我有一个名为Swf URL的字段:我在这里添加Swf链接,它链接到显示flash游戏的帖子。我想做同样的事情,但不是在帖子中,我想使用这个功能(在swf的帮助下添加游戏)到主页

现在情况如何:

我多么想看到:

功能代码:

load_theme_textdomain( "freebabyhazelgames", TEMPLATEPATH."/languages" );
$locale = get_locale( );
$locale_file = TEMPLATEPATH."/languages/{$locale}.php";
if ( is_readable( $locale_file ) )
{
    require_once( $locale_file );
}
$sp_boxes = array( "Game Details" => array( array( "thumb", "Game image URL:" ), array( "game", "Swf URL:" ) ) );
add_action( "admin_menu", "sp_add_custom_box" );
add_action( "save_post", "sp_save_postdata", 1, 2 );
if ( !function_exists( "get_custom_field" ) )
{
    function get_custom_field( $field )
    {
        global $post;
        $custom_field = get_post_meta( $post->ID, $field, true );
        echo $custom_field;
    }
}
<div id="playgame">
                        <script type="text/javascript">
                        <!--
                        swf("<?php $values = get_post_custom_values("game"); echo $values[0]; ?>", "701", "550");//-->
                        </script>
                    </div>
邮政编码:

load_theme_textdomain( "freebabyhazelgames", TEMPLATEPATH."/languages" );
$locale = get_locale( );
$locale_file = TEMPLATEPATH."/languages/{$locale}.php";
if ( is_readable( $locale_file ) )
{
    require_once( $locale_file );
}
$sp_boxes = array( "Game Details" => array( array( "thumb", "Game image URL:" ), array( "game", "Swf URL:" ) ) );
add_action( "admin_menu", "sp_add_custom_box" );
add_action( "save_post", "sp_save_postdata", 1, 2 );
if ( !function_exists( "get_custom_field" ) )
{
    function get_custom_field( $field )
    {
        global $post;
        $custom_field = get_post_meta( $post->ID, $field, true );
        echo $custom_field;
    }
}
<div id="playgame">
                        <script type="text/javascript">
                        <!--
                        swf("<?php $values = get_post_custom_values("game"); echo $values[0]; ?>", "701", "550");//-->
                        </script>
                    </div>


顺便说一句,我试图更改directory或将single.php复制到index.php,但都没有成功。

如果我没弄错,你想让游戏出现在主页上而不输入帖子吗?在这种情况下,我认为您可以尝试使用静态frontpage而不是最新的帖子


您可以在外观->自定义中找到它,然后选择frontpage作为静态。这样你就可以在静态frontpage上玩游戏。

我试过了,但只能在页面上玩,不能在帖子上玩。我有专门的领域写swf链接只为职位,而不是网页。但你明白得很清楚。试试这个插件,它可以让你通过使用短代码将最新的帖子拉到一个页面上。[get_posts numberposts=1 orderby=“date”]@user3771854,遵循艾哈迈德的建议,只需在页面内显示swf字段即可。自定义代码中的函数“添加自定义”框。