Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I run a multiple author site and the content is directed to various age groups. Instead of forcing the writer to manually note which age group the post is appropriate for, I want to add a content rating system with the following labels:

G — Suitable for all audiences

PG — Possibly offensive, usually for audiences 13 and above

R — Intended for adult audiences above 17

X — Even more mature than above

What would be a good way to add such feature? Ideally, on the post page, there is an area with radioboxes where the writer can make their selection. There must be a way to echo the choice in the post template.

Please provide code example if you choose to answer as my coding knowledge is limited.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Custom field will do the task. On the post page there's nothing to do great, just create a Custom Field called agerating or age-rating. Authors will enter the value of the field according to their content with G/PG/R/X.

Then at the frontend, edit single.php. Use this code inside the loop to retrieve the rating value:

<?php $age-rating = get_post_meta($post->ID, 'age-rating', true); ?>

Now use this code to show the rating:

Rated As: <?php echo $age-rating; ?>

Change the codes according to your needs. You can also style the Custom value box inside the Post panel after becoming experienced with this.

More Details: http://codex.wordpress.org/Custom_Fields

share|improve this answer
    
Thank you! This looks like it should do it... –  Amanda Duke Nov 4 '12 at 19:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.