Skip to main content
adding explanation of post_class and a code snippet
Source Link
mrwweb
  • 10.3k
  • 5
  • 40
  • 75

A custom meta box with a checkbox field would probably work best, but the easiest solution I can think of is this:

  1. Create an "Edited" category.
  2. Make sure you are using post_class()post_class() on the wrapper element of each article/post/page.*
  3. Add a CSS rule that looks for .category-edited class on the post wrapper (or .category-{ID}, which is safer if the "edited" slug ever changes).

The post_class() function (read about it on the Codex) is a template tag used in theme files. It's put on the wrapping element for each post in a loop. It can be on any HTML element, but common ones are div, article (HTML5 only), and li. Using the class looks like this:

<article <?php post_class(); ?>>
    <!-- stuff like the_title() and the_content() goes here. -->
</article>

Post_class() then generates something like "class='post post-23 category-events'".

A custom meta box with a checkbox field would probably work best, but the easiest solution I can think of is this:

  1. Create an "Edited" category.
  2. Make sure you are using post_class() on the wrapper element of each article/post/page.
  3. Add a CSS rule that looks for .category-edited class on the post wrapper (or .category-{ID}, which is safer if the "edited" slug ever changes).

A custom meta box with a checkbox field would probably work best, but the easiest solution I can think of is this:

  1. Create an "Edited" category.
  2. Make sure you are using post_class() on the wrapper element of each article/post/page.*
  3. Add a CSS rule that looks for .category-edited class on the post wrapper (or .category-{ID}, which is safer if the "edited" slug ever changes).

The post_class() function (read about it on the Codex) is a template tag used in theme files. It's put on the wrapping element for each post in a loop. It can be on any HTML element, but common ones are div, article (HTML5 only), and li. Using the class looks like this:

<article <?php post_class(); ?>>
    <!-- stuff like the_title() and the_content() goes here. -->
</article>

Post_class() then generates something like "class='post post-23 category-events'".

Source Link
mrwweb
  • 10.3k
  • 5
  • 40
  • 75

A custom meta box with a checkbox field would probably work best, but the easiest solution I can think of is this:

  1. Create an "Edited" category.
  2. Make sure you are using post_class() on the wrapper element of each article/post/page.
  3. Add a CSS rule that looks for .category-edited class on the post wrapper (or .category-{ID}, which is safer if the "edited" slug ever changes).