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
Related Posts:
- Display a custom field rating system in the front end
- How to change the case of all post titles to “Title Case”
- Dynamically add id to heading tags
- Confirmation box when submitting post for review
- Ajax Load More Posts in Category Page
- Publish pending article from front end with a button?
- List latest posts in WP-Admin
- Update all posts automatically when using post_meta
- Restrict users from editing post based on the age of the post
- Change slug with custom field
- Restrict access to post if it is currently being edited
- Getting an alphabetic post list with two letters onclick on letter
- Create new category upon save based on post information
- which action to hook to in order to perform post-publish action
- Strange switch_to_blog() issue
- POST from jQuery to PHP
- Search widget breaks when using multiple loops?
- $post object is null
- Advanced Custom Fields – Storing array value for further usage
- Function to show random posts from a category
- str_replace the_title(); blues
- Accessing post->ID outside of the loop for listing child pages
- how to set beforsend option in wordpress ajax methods
- Display post category in foreach loop with category link
- WordPress Custom Fields (Checkboxes with multiple values)
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Most liked page not displaying posts
- How to make number of blog posts a custom field?
- Error after upgrading WP from 4.0.6 -> 4.4.2: empty value in wp_post_types[‘post’]
- Creating a post from data returned from HTML form
- List authors with the last post title and order by last post date
- Display post category in foreach loop
- How to rate a post from Admin Side / Manually?
- Page template is accessing the incorrect posts?
- Can’t get full post title if there a spaces in title
- Get post meta retrieving wrong value
- Adding a user’s ID behind the tag ref link address
- How can I remove the first two words and shorten get_the_title()
- Can WordPress handle following functionalities?
- How to show 3 most recent/viewed posts in a special tiles on home page using wordpress?
- Dark Bar at the top of wordpress page can’t be seen?
- How to add PHP code snippet to all Post pages?
- How to display only one category in a custom post type?
- Display message depending on capability outside loop
- Limiting the amount of posts retrieved by the loop
- Hide content from Post Preview
- How to get the next and previous image title from attachment or gallery?
- displaying the categories post
- Adjust the order for returned posts
- How To Use Custom Fields With .mp3 Links
- Defining ‘last’ class on foreach blog posts
- Categories Listing and Highlighting current category item
- A better code for no post format?
- Help Combine These Two PHP Codes
- Adding Text after Post Title based on Category using IF Condition – But not for menu items
- Voting System, database connections?
- How to limit the number of results for all query_posts on mysite
- How to store post rating system data post independent?
- Show a Category Specific Info Box
- How to get all the terms of a post
- Get first comment link on the post itself
- User driven content problems
- How can i retrive the movies, trailers, news in a single page using search
- How can I create a menu items from meta box based on users input
- Older entries link within a category page
- How do I display a full post, not just an excerpt?
- Remove read more
- Insert new post for each user infinite loop error
- List direct children of page
- Unable to get posts with category on my page
- wordpress radio button on single post page
- How *not* to show the last post on the latest posts list
- Create post from form with image
- Exclude a ‘portfolio’ custom category?
- get value from post to sidebar
- Echo author slug in post edit page
- How can I get the media inside a post?
- how do I get a specific post from a post with a subcategory in WP
- Is it possible to change post id for an already added menu item in WordPress?
- List blocks created by a specific block plugin
- WP Bakery Load More Button loads the same posts
- How to Programmatically add an empty Block to every post on wordpress site?
- Assign category to new post via URL
- Setting posts_per_page for taxonomy term template
- Automatically create child pages and grandchild pages when saving a (parent) page
- API endpoint to get most-read and popular posts
- Blog post per page setting conflicting with custom WP_Query?
- Problem with permalink routing?
- Is it possible to run wp_kses on all posts?
- Change post order random through out the entire WordPress
- How to insert 2 args into 1 Wp_Query for a slideshow
- Adding custom fields to bbpress reply form
- Set size for attachments
- How to exclude latest x posts from a paginated query?
- Two loops, one AJAX loop, exclude posts in first loop from second loop, loops are in different files
- Classic editor throws 403 error based on post content
- Move first half of posts to one parent page, second half to the other page
- Check if checkbox is marked on publish/update post
- How to build a site with a map that shows where people offer and need help?
- wp_trim_words() does not work with my code Am I doing any mistake in my code?