Sun. Dec 22nd, 2024

background image

Would your weblog have the benefit of casting off the dates of the posts? That’s the query I requested at the publish “Must We Take away the Timestamp?”. The comments from the readers used to be divided. Some folks consider that the timestamp is vital, whilst others assume that casting off the date from posts will have benefits, like expanding the quantity feedback and linkbacks for the older content material .

It’s almost definitely a subjective topic. Putting off the date will paintings for some blogs, and now not for others. Irrespective of that selection, a large number of folks aren’t ok with enhancing the WordPress theme recordsdata to take away the timestamp. Secondly, the uncooked enhancing of such recordsdata don’t supply flexibility. You’ll both stay the dates on all of the posts or got rid of all of them, there’s no in between.

With that downside in thoughts Stephen determined to code a plugin, known as Date Exclusion.

Date Exclusion Plugin

This WordPress plugin offers the person entire regulate over the place and when the timestamp will likely be displayed. You’ll exclude them from all posts via default or best on posts older than a couple of weeks or months. You’ll additionally exclude or come with dates on a publish-via-publish degree via WordPress’ customized box characteristic.

Set up

  1. Obtain and unzip the plugin report
  2. Add the date-exclusion.php report in your /wp-content material/plugins/ listing
  3. Log into your WordPress regulate panel, click on the “Plugins” tab, and click on “Turn on” subsequent to the Date Exclusion plugin

Configuration

As a way to configure the plugin to your wishes you’ll have to open the plugin report (date-exclusion.php). You’ll do that at the Plugin Editor throughout the WordPress regulate panel.

To exclude date knowledge from all posts via default, set $exclude_date on line 30 equivalent to ‘sure’. This will also be overridden on a publish-via-publish foundation via environment “exclude_date” as a customized box with a price of “no”.

To set a default time frame for each publish and then date knowledge must now not be displayed, set $date_expires on line 33 to the collection of days to attend (e.g., 14 for 2 weeks). This will also be overridden on a publish-via-publish foundation via environment “date_expires” as a customized box with a distinct price (or 0 to deactivate).

To exclude date knowledge from a particular publish, set “exclude_date” as a customized box with a price of “sure”.

To make the date of a particular publish now not show after a undeniable time frame, set “date_expires” as a customized box with a price equivalent to the collection of days you wish to have the date to show.

Model Historical past

Nonetheless at the preliminary free up (1.0). Please go away a remark should you come across any difficulties.

Daniel Scocco

About Daniel

Daniel Scocco is a programmer and entrepreneur positioned in São Paulo, Brazil. His first corporate, On-line Earnings, builds and manages internet sites in several niches. His 2nd corporate, Kubic, makes a speciality of creating cell apps for the iOS and Android platforms.