Support

Account

Home Forums ACF PRO acf_add_options_page() | does not display

Solving

acf_add_options_page() | does not display

  • HI, I have problem with display date from field <?php the_field(‘field_name’, ‘option’); ?>

    My code in functions.php

    //  ----------------------------------------
    //  ACF option page
    //  ----------------------------------------
    
    if( function_exists('acf_add_options_page') ) {
        
        acf_add_options_page(array(
            'page_title'    => 'Theme General Settings',
            'menu_title'    => 'Footer1',
            'menu_slug'     => 'footer1',
            'capability'    => 'edit_posts',
            'redirect'      => false
        ));
        
    }

    And code in template:

    <span><?php the_field('opis_footer', 'footer1') ?></span>

    I did also:

    <?php var_export(the_field('opis_footer', 'footer1')) ?>

    and it looks like it returns NULL

    ACF PRO 5.6.9
    Wordpress 4.9.4
    Testet on PHP 5.6 & 7.1

    Any ideas ?

  • Do you maybe have WPML installed ?

  • hey Bee, nope I don’t have WMPL installed. My plugins are:

    1. Advanced Custom Fields PRO
    2. Akismet Anti-Spam
    4. Hello Dolly
    5. Meks Smart Social Widget
    6. WP Social Widget

  • Oh wait… it looks like your syntax is wrong.

    the_field('field_name', 'option')

  • Hey,
    you mean
    get_field('field_name', 'option') instead the_field('field_name', 'option') ?

    if yes, the result is still same… :-/

  • the_field echoes the value.
    get_field returns the value (but doesn’t echo).

    Have you tried deactivating all other plugins and revert tot a default (WP) theme ?
    Does the problem still exist then ?

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.