我有自定义模板,我需要得到og:在标题图像url。类映像在DB wp\\u postmeta-meta\\u value中的位置我尝试使用函数。php
function getOgImage()
{
global $wpdb;
$ogimage = $wpdb->get_results("SELECT DISTINCT post_id FROM wp_postmeta WHERE meta_value", OBJECT);
echo \'<meta property="og:image" content="\'.$ogimage.\'"/>\';
}
add_action(\'wp_head\', \'getOgImage\');
Im外出:
<meta property="og:image" content="Array" />