Php 如何在自定义帖子类型中创建自定义字段?

Php 如何在自定义帖子类型中创建自定义字段?,php,wordpress,post,types,ctp,Php,Wordpress,Post,Types,Ctp,我有一个自定义帖子类型页面,这是我使用的代码: <?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( $a

我有一个自定义帖子类型页面,这是我使用的代码:

<?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();
?>


有人知道我如何在那里添加AFC吗?

要在主题中显示ACF,请使用
字段()


您可以使用_字段功能

the_field("your_custom_field");

这不可能是什么,我不想使用插件。我想自己编写代码。但是我在网上找不到任何好的教程如果你想添加一个元框,而不是一个高级自定义字段,那么你的问题就离题了。“ACF”代表高级自定义字段…这是一个插件@Dinesh有一个正确的答案。我已经在我的主题中添加了自定义帖子类型,现在我想添加(高级)自定义字段。如果Advanced(…)是一个插件,那么我很抱歉。我不想安装插件,我需要一些代码将其编码到我的模板中。你正在尝试添加元框、值和键。不是田地。
the_field("your_custom_field");