WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to have a birthday field on database then use the age to restrict viewing posts?

share|improve this question

closed as unclear what you're asking by toscho Jul 23 '13 at 23:52

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

There are probably a few ways to do this. The easiest way I can think of is to install Pods Framework. You can install it through the WordPress repository like you'd normally install a plugin, or through GitHub. Using Pods, you can extend the WordPress user database to add a birthday field. You can also use it to extend your posts and pages by adding a custom field where you can enter your age restriction. Pods is very easy to use, and once you have everything set up, it's just a matter of editing some code in your template files to read the data. Data can be stored in separate MySQL tables, but in this case, I think the simplest way to do it is to store it as meta keys / meta values (which is the standard in WordPress).

share|improve this answer
+1 for Pods, didn't know it existed. – montrealist Mar 25 '13 at 5:52
Now what is the code to restrict posts using the birthdate field? – Jayson Pimentel Mar 25 '13 at 7:34
@JaysonPimentel - You need to research and try to solve the problem first. When that fails, show us the code you tried. Anyway, julian said: "You can also use it to extend your posts and pages by adding a custom field where you can enter your age restriction." In this case, you need to install the framework from the link above, read its documentation and then read the wordpress codex to learn about custom fields. If you still need help, present the solution you tried so people have somethin to look at. Or, hire a developer. – Androliyah Mar 25 '13 at 10:40
Leads: google.com/… – Androliyah Mar 25 '13 at 10:42
Adults Only Age Verification bloggermint.com/2012/06/… – Androliyah Mar 25 '13 at 10:43

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