View Display post custom field example
<?php | |
global $wp_query; | |
$postid = $wp_query->post->ID; | |
echo get_post_meta($postid, 'title-2', true); | |
wp_reset_query(); | |
?> |
View WP show post shortcode function
function dispos_func( $atts ) { | |
$atts = shortcode_atts( | |
array( | |
'post_id' => 'no foo', | |
), $atts, 'DisplayPost' ); | |
$post_id = $atts['post_id']; | |
return get_post_field('post_content', $post_id); | |
} | |
add_shortcode( 'DisplayPost', 'dispos_func' ); |