WordPress.org

Support

Support » Themes and Templates » [Resolved] A Checkbox to display or disable content

[Resolved] A Checkbox to display or disable content

  • I have a custom post type which I would like to add a content box to.

    Some of the pages won’t have this box so I have added a checkbox into a custom metabox.

    I would like to only display the box on my site when I tick the checkbox.
    I suppose it is similar to showing or hiding the comments options on a page.

Viewing 1 replies (of 1 total)
  • got this working my by adding in:

    <? if (get_post_meta($post->ID, 'hd_checkitem', true)) { ?>
        my content here
        <? } else { ?>
    <? } ?>

    hd_checkitem is just the name from the prefix and id for that item in the metabox

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] A Checkbox to display or disable content’ is closed to new replies.
Skip to toolbar