0

I've got a custom post type (Places), and that post type has a custom field to indicate that the Place is a participant in a holiday-season promotion. I would like to create a setting somewhere so that I could set the begin and end date of the promotion, and then be able to show or hide that field.

For now I have to manually edit templates when the promotion begins and ends, but I'd prefer to adjust it from a settings page in the admin screen. Is this possible?

Roughly this:

if ( is_place() ) :
    if ( is_date( wp_setting( 'promotion_dates' ) ) :
        echo 'Promotion';
    endif;
endif;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.