Support

Account

Home Forums General Issues Checkbox value not displaying

Solved

Checkbox value not displaying

  • Hi,

    I’m having trouble with a check box not returning a value. I’m trying to make a option for a page to show/hide page titles, but I’m unable to get the value.

    I have tried this after seeing a similar issue here http://goo.gl/My3nq

    <?php
    $option = get_field('hide_page_title');
    
    echo '<pre>';
    	var_dump( $option );
    echo '</pre>';
    die;
    
    ?>

    It returns “bool(false)” no matter if it is checked or not. And the_field(‘hide_page_title’) return nothing.

    Other fields seem to working OK.

    Can anyone help me please?

  • Hi @Cloud9

    The issue will be 1 of 2 things:

    1. The field name is incorrect. Please double check it
    2. The global $post object is not correct. This is more likely the case and to help you further I will need to know:

    Where is the data saved?
    What template are you loading the data from?

  • Hi Elliot,

    Thanks for the reply. I’m using a custom child theme I’m building based on the Roots theme ( http://www.rootstheme.com/ )

    I’m not sure what you mean when you say ‘where is te data saved’.

    The template is a custom one which looks like this http://snipt.org/AFah6/Dark

    I have attached two screen shots that might help.

    Thanks

  • Hi @Cloud9

    Looking at your screenshot it seems you have a spelling mistake in your field name!

  • Elliot,

    I’m SO sorry for wasting your time. But thanks all the same.

    *hangs his head in shame*

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

The topic ‘Checkbox value not displaying’ is closed to new replies.