• I have wordpress flash game website. Into the admin panel, where I add or edit post I have field named Swf URL: where I add SWF link and it links to the post where it shows flash game. I want to do same but not in the post, I want to use this function (adding game with the help of swf) to home page.

    How it is now:

    View post on imgur.com

    How I want to see:

    View post on imgur.com

    functions code:

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    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;
        	}
        }
    
    <strong>post code:</strong>
    
        <div id="playgame">
        						<script type="text/javascript">
        						<!--
        						swf("<?php $values = get_post_custom_values("game"); echo $values[0]; ?>", "701", "550");//-->
        						</script>
        					</div>

    By the way I tried to change dirrectory or to copy single.php to index.php but both not worked.

Viewing 1 replies (of 1 total)
  • You need to insert your code between backticks, or use the “code” button.

    Your code may have been permanently altered and we may not be seeing what you posted.

Viewing 1 replies (of 1 total)
  • The topic ‘Insert SWF in home page instead of post’ is closed to new replies.