admin管理员组

文章数量:1406462

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;

本文标签: Custom setting to show or hide field