2014-09-22 25 views
0

我希望你的一切都很好。 請, 我爲wordpress安裝了一個插件woo-commerce。 當我創建產品時,我沒有看到任何產品的作者, 請問,我如何將作者添加到每個產品?插件woo-commerce,沒有作者的產品

致以問候

A.J.

+0

入住這http://wordpress.stackexchange.com/questions/74054/woocommerce-assign-an-author-to-a-product – 2014-09-22 05:50:03

+0

WOW,非常漂亮。先生,謝謝你。 – alaa 2014-09-22 05:58:28

回答

0

在WordPress中,每個帖子或自定義帖子(WooCommerce產品)都有一個作者。如果要在「產品」頁面上顯示產品作者,請將以下代碼複製並粘貼到您的functions.php文件中。

add_filter('manage_posts_columns', 'wdm_columns_head'); 
add_action('manage_posts_custom_column', 'wdm_columns_content', 10, 2); 

function wdm_columns_head($defaults) { 
    $defaults['Author'] = 'Author'; 
    return $defaults; 
} 

function wdm_columns_content($column_name, $post_ID) { 
    if ($column_name == 'Author') { 
     $post_featured_image = get_the_author($post_ID); 
     if ($post_featured_image) { 
      echo $post_featured_image; 
     } 
    } 
} 
+0

謝謝,先生,您的反饋。我做到了,但....請檢查:http://grab.by/Ayk0 – alaa 2014-09-22 06:03:19

+0

非常感謝你們,我通過您的支持解決了我的問題。 – alaa 2014-09-22 06:16:47