• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Checkbox Code To Add or Remove Featured Image

This code adds a checkbox to enable or disable the featured image from displaying on single posts and pages.

No plugin needed.

By default, the code adds the featured image on single posts if the featured image is checked on the Genesis > Theme Settings > Content Archive settings.

content-archives

You can then remove the image simply by ticking a checkbox located below the wp editor on all Edit Post screens like this:

image-checkbox

The code also enables you to change the position the image displays so you can move it to after the entry title or any other genesis hook location.

Demo Video

Works in any Genesis child theme.

Installation

Step 1: Simply add the following line of PHP code to the end of your child themes functions file:

include_once( get_stylesheet_directory() . '/featured-image-checkbox.php' );

Step 2: Download the featured-image-checkbox.php file below and upload it to your child themes root directory.

Here’s the featured-image-checkbox.php file for logged in members:

Register for full access

Related Code

  • Remove Featured Image From Specific Archive Entries
  • Add Featured Image To Single Post Using The Customizer
  • Add or Remove Image Before or After Post Title

Featured Image Meta Box

Reader Interactions

Comments

  1. Dan-cer says

    January 20, 2017 at 1:21 pm

    Hi Brad,
    thank you for this tutorial. Unfortunately it doesn’t work here. There is also a plugin called ‘Hide Featured Image’ that won’t work either.
    Don’t know why. I disabled a lot of 3rd-party-plugins, but without any effect on this problem.
    Have you an idea to solve this?

    kind regards
    Rainer

    site: https://www.official.jungvital.com

    Log in to Reply
    • Brad Dalton says

      January 20, 2017 at 4:28 pm

      Hi

      I’ll take a look on Monday however i do test all code and know it works.

      You will need to read the entire tutorial in case you have missed something.

      The video also proves it works. I cannot access your code from the front end.

      Log in to Reply
      • Dan-cer says

        January 20, 2017 at 11:36 pm

        thank you, Brad.
        If you like to look at backend:
        https://www.jungvital.com/wp-login.php
        admin: Adonais-son
        login: VdF5jdi$EITR2Mlfk0GEDOXa

        Log in to Reply
        • Brad Dalton says

          January 21, 2017 at 2:21 am

          Only works in Genesis. Looks like you have a non Genesis theme active.

          Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.