Support

Account

Home Forums General Issues Checkbox value not displaying

Solved

Checkbox value not displaying

    • Ash

    • July 9, 2013 at 2:04 am

    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?

    • Elliot

    • July 9, 2013 at 9:48 am

    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?

    • Ash

    • July 9, 2013 at 6:07 pm

    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

    • Elliot

    • July 10, 2013 at 2:53 pm

    Hi @cloud9

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

    • Ash

    • July 10, 2013 at 6:01 pm

    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)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.