I want to show a custom post type chosen from the meta box dropdown list but i am getting this error Notice: Trying to get property of non-object in C:\xampp\htdocs\wordpress\wp-content\themes\affiliator\footer.php on line 20
Here is my code:
$get_footer = get_post_meta( get_the_id(), 'af_choose_layout', true );
if( !empty( $get_footer ) ){
$footer = get_post( $get_footer );
echo apply_filters('the_content',$footer->post_content);
}
So i just want to get the id of the custom post that can be usable for get_post(some id here...)
. Please help me to fix this
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744586047a4582315.html
评论列表(0条)