Logic in Custom Post Types – Time sensitive output

[ad_1]

I’m attempting to add a time-sensitive discount code component into my GeoDirectory business post type. I couldn’t find any other posts related to this.

My current approach is to add 4 fields, “discount_description”, “discount_code”, “discount_expiry_date”, “discount_active”, and then somehow filter the post_meta before it is output so as to not publish any of these fields in the final post if the discount_expiry_date has been passed or the discount_active is false.

My guess is that I need to make a custom shortcode for the output or to somehow hook into the gd_post_meta shortcode, but I’m not entirely sure how to go about this as I can’t find enough information in the GeoDirectory documentation or by searching the code to help me determine how to tap into it or what object to modify if anything.

I have the Code Snippets plugin installed. Any help would be much appreciated.

The page I need help with: [log in to see the link]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer