Php 将图像字段添加到wordpress类别

Php 将图像字段添加到wordpress类别,php,database,wordpress,Php,Database,Wordpress,我试图在数据库中的wp_term表中添加一个图像字段,我将其称为图标 我希望该字段包含一个URL到一个图像,该图像将是该类别的拇指。 我已经将该字段添加到DB中,并将其插入管理面板中的代码中: <?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?> <tr class="form-field"> <th scope="row" valign="top"><label for="i

我试图在
数据库中的
wp_term
表中添加一个图像字段,我将其称为
图标

我希望该字段包含一个
URL
到一个图像,该图像将是该类别的拇指。 我已经将该字段添加到
DB
中,并将其插入管理面板中的代码中:

<?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?>
    <tr class="form-field">
        <th scope="row" valign="top"><label for="icon"><?php _ex(' Icon', 'Taxonomy Icon'); ?></label></th>
        <td><input name="icon" id="icon" type="text" value="<?php if ( isset( $tag->icon ) ) echo esc_attr($tag->icon); ?>" size="40" />
        <p class="description"><?php _e('The &#8220;icon&#8221; is the URL to the category icon. if it is an uploaded image it will be http://'.$_SERVER['SERVER_NAME'].'/wp-content/uploads/{your_file.name}.'); ?></p></td>
    </tr>
<?php endif; // is_taxonomy_hierarchical() ?>


我发现了一个很好的插件,它可以让你在一篇文章中添加各种各样的字段,这篇文章名为


祝你好运:)

一个小时后,它将永远消失在堆栈溢出档案中。比9gag上的帖子快。