admin管理员组

文章数量:1296318

header.php

<script async defer crossorigin="anonymous" src=".js#xfbml=1&version=v10.0&appId=MyAppIDHere&autoLogAppEvents=1" nonce="mZmuaaHP"></script>

Shortcode: functions.php

 
function print_onview_meta($atts) {
 
    global $post;
    $meta = get_post_meta($post->ID);
 
    extract(shortcode_atts(array('key' => ''), $atts));
 
    if($key && array_key_exists($key, $meta)) {
 
        return $meta[$key][0];
 
    }
    
}

Custom Field: wilcity_custom_new_facebook_feed

Output:

<div class="fb-page" data-href="/[onview_meta key='wilcity_custom_new_facebook_feed']" data-tabs="timeline, events, messages" data-width="500" data-height="" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"></div>

The result on page is blank, but when I have a look at the dev console it displays the exact code as in the output config above, including the shortcode etc.

What is going wrong here? Any help would be highly appreciated. (A friend told me I can configure the entire output in the shortcode with echo, but I have no idea how to do this)

本文标签: Shortcode not working inside div html