php - Advanced Custom Fields Not Displaying on Desired Page -


i'm using advanced custom field (acf) plugin wordpress blogs. each blog has same general heading/logo page.

immigration law

health law

the 2 elements change standard colors associated blog's name , name of blog (i.e. health vs immigration).

i've added few acf fields new group (blog_type, blog_name, blog_color) , inserted them header.php file want them. i've assigned them following location rules:

user, equal to, administrator (and)

page, equal to, home

when choose update , proceed home page, new fields should there not.

i did little digging , found needed add exported info generates functions.php page in child theme. when , go group details in plugin menu, 1 of fields gone.

not sure i'm doing wrong.

wordpress version: 4.2.2

parent theme: elegant themes - divi (version 2.3.1)

acf plugin version: 4.4.2

edit: here's code added header.php

<h1>     <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">knowing<span style="color: <?php the_field('blog_color');?>;"><?php the_field('blog_name');?></span><?php the_field('blog_type');?></a> </h1> 

this code export function gave me functions.php file:

if(function_exists("register_field_group")) {     register_field_group(array (         'id' => 'acf_blog-details',         'title' => 'blog details',         'fields' => array (             array (                 'key' => 'field_55a40afe0bf59',                 'label' => 'blog color',                 'name' => 'blog_color',                 'type' => 'color_picker',                 'required' => 1,                 'default_value' => 'rgb(210,120,40)',             ),             array (                 'key' => 'field_55a41857b2d0f',                 'label' => 'blog name',                 'name' => 'blog_name',                 'type' => 'text',                 'required' => 1,                 'default_value' => 'blog',                 'placeholder' => 'blog name',                 'prepend' => '',                 'append' => '',                 'formatting' => 'html',                 'maxlength' => '',             ),             array (                 'key' => 'field_55a41859b2d10',                 'label' => 'blog type',                 'name' => 'blog_type',                 'type' => 'radio',                 'instructions' => 'choose type of blog',                 'required' => 1,                 'choices' => array (                     'blog' => 'blog',                     'relations' => 'relations',                 ),                 'other_choice' => 0,                 'save_other_choice' => 0,                 'default_value' => '',                 'layout' => 'vertical',             ),         ),         'location' => array (             array (                 array (                     'param' => 'ef_user',                     'operator' => '==',                     'value' => 'administrator',                     'order_no' => 0,                     'group_no' => 0,                 ),                 array (                     'param' => 'page',                     'operator' => '==',                     'value' => '23',                     'order_no' => 1,                     'group_no' => 0,                 ),             ),         ),         'options' => array (             'position' => 'normal',             'layout' => 'no_box',             'hide_on_screen' => array (                 0 => 'custom_fields',             ),         ),         'menu_order' => 0,     )); } 

edit 2:

okay found strange out, when removed user = admin out location rules, showed up. want admins see that. not sure do.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -