我对角很陌生,但我已经成功地建立了一个list.html模板,使用WP的V2在Wordpress中显示帖子。现在,我想显示一些(ACF)字段从我的帖子列表上方的另一页。我也安装了ACF插件,它确实适用于posts。
我只是不知道如何引用正确的页面ID,也不知道是否需要为此设置另一个控制器。
<!-- try to get data out of page id 2 > http://www.example.com/wp-json/acf/v2/page/2 -->
<h1 ng-bind-html="pages:2.acf.title">not w
使用ACF;我正在制作一个插件,连接到'draft_to_publish‘和'pending_to_publish’上的WP --这个部分工作得很好。但是当我试图得到ACF生成的字段时,它们作为空白返回,好像ACF生成的字段还没有被设置一样。
我的插件的短版本如下:
function scheduelMailChimp( $post ) {
// get post data and preb it for mail
$post_ID = get_the_ID();
$content_post = get_post( $post_ID )
我试图通过自定义字段更改特定帖子类型的帖子标题(后端和前端)。我使用的自定义字段是一个分类字段,您可以从不同的类别(cars)中进行选择。我用的是这个代码:
//Save ACF field as post_content for back-end
add_action('save_post', 'change_title_cars');
function change_title_cars($post_id) {
global $_POST;
if('cars'== get_post_type())
{
在post.featured_image_src项目中,试图将图像设置为div背景映射函数,但无法访问React.js外部映射函数,并将其设置为divStyle变量中的背景:
class Archive extends Component {
render() {
let allPosts = DataStore.getAllPosts();
let pageData = DataStore.getPageBySlug('archive');
let acf = pageData.acf;
const d