functions.php
おそらく、次のような特定の HTML コンテンツでカスタム関数を簡単に追加できます。
/* add content */
function customContent() {
echo '<div><p>Custom Lorem Ipsum Content</p></div>';
}
/* add action */
add_action('load-index.php', 'customContent');
この流れで、ダッシュボード内の管理バーの下にいくつかの customContent をすべてのユーザーに表示しています。しかし、今ではスタイリングを行うのはかなりの作業になります. では、通常の customDashboardWidgets とその機能を使用して、スタイリングをリセットしてみませんか?
/* add content */
function customContent() {
echo '<div><p>Custom Lorem Ipsum Content</p></div>';
}
/* add widget */
function add_customDashboardWidget() {
wp_add_dashboard_widget('wp_dashboard_widget', 'Custom Content', 'customContent');
}
/* add action */
add_action('wp_dashboard_setup', 'add_customDashboardWidget' );
最後に、スタイリングを行うことができます。
<style type="text/css">
.postbox,
.postbox div.handlediv,
.postbox h3.hndle {
background: none;
border: none;
}
</style>
注: CSS 内にスタイルを挿入する場合は、CSS の前後の PHP タグを正しく閉じたり開いたりしてください。functions.php