显示帖子Wordpress的自定义CSS和HTML说明

时间:2011-10-16 20:55:04

标签: wordpress post admin customization

我正在为一些人创建一个博客,他们将在我创建的5个不同的自定义帖子中将帖子放在他们的网站上。

由于某些类别要求用户指出发布数据(因此创建ul> li),因此请确保它在网站上显示时正确设置样式。

要确保网站的编辑者正确地将数据输入到管理后区域,我希望这样做。

  1. 在新/编辑帖子屏幕的右侧显示图像,其中包含有关如何创建自定义帖子的说明。
  2. 或/和

    1. 有水印输入表格(比如它在这里“插入标题”)以举例说明如何显示数据。
    2. 我正在使用插件更多字段来显示我的输入字段。这可以选择插入HTML,我在将这些图像和代码放置在这些中的过程中取得了不同的成功,因为它看起来是零星的,如果有效的话!

      非常感谢任何帮助。

      的Si

1 个答案:

答案 0 :(得分:0)

如果我理解正确,custom meta box可以解决这个问题。

add_action( 'add_meta_boxes', 'wpse_54822_add_custom_box' );

function wpse_54822_add_custom_box() 
{
    $post_types = array( 'post', 'movies', 'testimonial' );

    foreach( $post_types as $box )
    {
        add_meta_box(
            'wpse_54822_sectionid',
            __( 'Instructions' ), 
            'wpse_54822_inner_custom_box',
            $box,
            'side'
        );
    }
}


function wpse_54822_inner_custom_box() 
{
    ?><pre>
&lt;b&gt;This text is bold&lt;/b&gt;
&lt;strong&gt;This text is strong&lt;/strong&gt;
&lt;i&gt;This text is italic&lt;/i&gt;
&lt;em&gt;This text is emphasized&lt;/em&gt;
&lt;code&gt;This is computer output&lt;/code&gt;</pre>
    <?php
}

导致:
custom meta box with instructions


其他可能性是插入自定义Help Tab

相关问题