• Hello everybody.

    I have the following problem. This is my current code I tried to use to show my custom field of a page:

    if( is_single() || is_page() ) {
    
        global $post;
        $post_id = $post;
    
        if (is_object($post_id))
        $post_id = $post_id->ID;
    
        $pic = get_post_meta($post_id, '_pic', true);
    
        if ( isset($pic) && !empty($pic) && strstr($pic, "https://") )
    echo $pic ';

    but nothing happens… it works very well with posts but not with pages. can someone pls help me. thx a lot ??

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with Custom Fields off Pages’ is closed to new replies.