2014-11-14 119 views
-1

我有一个自定义文章类型页,这是我的代码使用方法:如何在自定义帖子类型中创建自定义字段?

<?php 
get_header(); 
get_sidebar(); 
the_meta(); 
?> 

<ul class="event"> 
    <?php $args = array('post_type' => 'event-netzwerk', 'posts_per_page' => 30, 'orderby' => 'rand'); 
    $loop = new WP_Query($args); 
    while ($loop->have_posts()) : $loop->the_post(); 
    echo '<li>'; 
    the_title('<h3>', '</h3>'); 
    the_content(); 
    echo '</li>'; 
    endwhile; ?> 
</ul> 


<?php 

get_footer(); 
?> 

有谁知道我怎么可以添加一个亚冠吗?

回答

1

要在主题显示ACF使用the_field()

<h1><?php the_field('custom_title'); ?></h1> 
+0

这不可能是任何东西,我不想使用插件。我想用我自己编码。 但我找不到任何好的教程在互联网上 –

+0

你想添加自定义字段在自定义文章类型....? – Dinesh

+0

如果你想添加一个元框,但不是高级自定义字段,那么你的问题是脱离主题。 “ACF”代表高级自定义字段...这是一个插件。 @Dinesh有一个正确的答案。 – rnevius

相关问题