我成功了。如何发布不同类型的\\u mime\\u?我在函数中添加了post\\u mime\\u type。php
add_filter(\'upload_mimes\', \'pixelo_upload_types\');
function pixelo_upload_types($existing_mimes=array()) {
$existing_mimes[\'otf\'] = \'otf\';
$existing_mimes[\'ttf\'] = \'ttf\';
return $existing_mimes; }
然后我在这里尝试了一下,但没有成功。
<?php
$args = array(
\'numberposts\' => -1,
\'orderby\' => \'menu_order\',
\'order\' => \'ASC\',
\'post_type\' => \'attachment\',
\'post_parent\' => $post->ID,
\'post_mime_type\' => \'ttf\'
);
$font = get_posts($args);
if($font) {
foreach($font as $key => $data) : ?>
<option value="<?php echo $data->ID; ?>"><?php echo $data->post_title; ?></option>
<?php endforeach;
} ?>
请帮帮我。请帮帮我。我怎样才能做到?