Support

Account

Home Forums Front-end Issues Using Post_Object only returning IDs? Reply To: Using Post_Object only returning IDs?

  • No was a total error. Been grinding for 3 days with zero luck getting data. Put messy code together just to show it to find out why only ID’s where called. Just updated with you recommended document code again.

    <?php $post_object = get_field('get_game_details');
    if( $post_object ): 
    	// override $post
    	$post = $post_object;
    	setup_postdata( $post ); ?>
            <?php get_template_part( 'game_details', 'index' ); ?>
        <?php wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly ?>
    <?php endif; ?>

    However I still cannot figure out why only ID's are called and not the display of the data.
    For Example – 47 = Pokemon X & Y

    To further explain. When viewed from normal post type all data is fully visible. However when viewed from my custom post type 'Games Information' (that also uses custom Toxonomys), all the data is simple ID's.

    add_action( 'init', 'register_cpt_game_information' );
        function register_cpt_game_information() {
        $labels = array(
        'name' => _x( 'Games Information', 'game_information' ),
        'singular_name' => _x( 'Game Information', 'game_information' ),
        'add_new' => _x( 'Add New', 'game_information' ),
        'add_new_item' => _x( 'Add New Game Information', 'game_information' ),
        'edit_item' => _x( 'Edit Game Information', 'game_information' ),
        'new_item' => _x( 'New Game Information', 'game_information' ),
        'view_item' => _x( 'View Game Information', 'game_information' ),
        'search_items' => _x( 'Search Games Information', 'game_information' ),
        'not_found' => _x( 'No games information found', 'game_information' ),
        'not_found_in_trash' => _x( 'No games information found in Trash', 'game_information' ),
        'parent_item_colon' => _x( 'Parent Game Information:', 'game_information' ),
        'menu_name' => _x( 'Games Information', 'game_information' ),
        );
        $args = array(
        'labels' => $labels,
        'hierarchical' => true,
        'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes' ),
        'taxonomies' => array( 'category', 'post_tag' ),
        'public' => true,
        'show_ui' => true,
        'show_in_menu' => true,
        'menu_position' => 5,
        'show_in_nav_menus' => true,
        'publicly_queryable' => true,
        'exclude_from_search' => false,
        'has_archive' => true,
        'query_var' => true,
        'can_export' => true,
        'rewrite' => true,
        'capability_type' => 'post'
        );
        register_post_type( 'game_information', $args );
        }
    add_action( 'init', 'register_taxonomy_game_title' );
        function register_taxonomy_game_title() {
        $labels = array(
        'name' => _x( 'Game Title', 'game_title' ),
        'singular_name' => _x( 'Games Title', 'game_title' ),
        'search_items' => _x( 'Search Game Title', 'game_title' ),
        'popular_items' => _x( 'Popular Game Title', 'game_title' ),
        'all_items' => _x( 'All Game Title', 'game_title' ),
        'parent_item' => _x( 'Parent Games Title', 'game_title' ),
        'parent_item_colon' => _x( 'Parent Games Title:', 'game_title' ),
        'edit_item' => _x( 'Edit Games Title', 'game_title' ),
        'update_item' => _x( 'Update Games Title', 'game_title' ),
        'add_new_item' => _x( 'Add New Games Title', 'game_title' ),
        'new_item_name' => _x( 'New Games Title', 'game_title' ),
        'separate_items_with_commas' => _x( 'Separate game title with commas', 'game_title' ),
        'add_or_remove_items' => _x( 'Add or remove game title', 'game_title' ),
        'choose_from_most_used' => _x( 'Choose from the most used game title', 'game_title' ),
        'menu_name' => _x( 'Game Title', 'game_title' ),
        );
        $args = array(
        'labels' => $labels,
        'public' => true,
        'show_in_nav_menus' => true,
        'show_ui' => true,
        'show_tagcloud' => true,
        'show_admin_column' => false,
        'hierarchical' => true,
        'rewrite' => true,
        'query_var' => true
        );
        register_taxonomy( 'game_title', array('game_information'), $args );
        }