I am trying to use this code in my WordPress site
<?php
if(get_post_format() == 'video'){
function insert_game(){
get_template_part( 'content', 'video-top' );
}
add_action( 'colormag_after_header', 'insert_game' );
}
?>
<?php get_header(); ?>
and in content-video-top.php is this code
echo get_post_meta( $post->ID, 'video', true );
The problem is that it doesn't show the custom fields, but after get_header()
it works.