Display Profiles with Upcoming, Recent and Today's Birthdays
This article guides you in setting up Member Directories to display Profiles with Upcoming, Recent, and Today's Birthdays.
Note: You can add the code to your theme's functions.php file or use the Code Snippet plugin to run the codes below.
Today's Birthdays
To display the Profiles with Today's Birthdays, you need to create a new Member Directory with the following settings:
- General Options > View type(s) > check the "List" only.
- General Options > Default view type > set it to "List"
- Profile Card > Enable Profile Photo > Turn it On.
- Profile Card > Show tagline below profile name > Turn it On.
- Profile Card > Choose field(s) to display in tagline > add "Birth Date"
- Results & Paginations > Number of profiles per page > set the value to "4"
- Results & Paginations > Number of profiles per page (for Mobiles & Tablets) > set the value to "4".
Once the Member Directory settings are saved, copy the directory ID from the URL or see the "Shortcode" section in the settings.
We need to modify the newly created directory to query the profiles with Today's Birthdays from the database with the following code snippet (You need to change the directory ID "320" to match the ID of your newly created directory):
Upcoming Birthdays
To display the Profiles with Upcoming Birthdays, you need to create a new Member Directory with the following settings:
- General Options > View type(s) > check the "List" only.
- General Options > Default view type > set it to "List"
- Profile Card > Enable Profile Photo > Turn it On.
- Profile Card > Show tagline below profile name > Turn it On.
- Profile Card > Choose field(s) to display in tagline > add "Birth Date"
- Results & Paginations > Number of profiles per page > set the value to "4"
- Results & Paginations > Number of profiles per page (for Mobiles & Tablets) > set the value to "4".
Once the Member Directory settings are saved, copy the directory ID from the URL or see the "Shortcode" section in the settings.
We need to modify the newly created directory to query the profiles with Today's Birthdays from the database with the following code snippet ( You need to change the directory ID "325" to match the ID of your newly created directory):
Recent Birthdays
To display the Profiles with Recent Birthdays, you need to create a new Member Directory with the following settings:
- General Options > View type(s) > check the "List" only.
- General Options > Default view type > set it to "List"
- Profile Card > Enable Profile Photo > Turn it On.
- Profile Card > Show tagline below profile name > Turn it On.
- Profile Card > Choose field(s) to display in tagline > add "Birth Date"
- Results & Paginations > Number of profiles per page > set the value to "4"
- Results & Paginations > Number of profiles per page (for Mobiles & Tablets) > set the value to "4".
Once the Member Directory settings are saved, copy the directory ID from the URL or see the "Shortcode" section in the settings.
We need to modify the newly created directory to query the profiles with Today's Birthdays from the database with the following code snippet ( You need to change the directory ID "328" to match the ID of your newly created directory:
You can add all member directories that you've created above on a page and display them with their shortcodes.
Extra Features
If you want to display the future age of a user for the Upcoming Birthdays, use the following code snippet below ( You need to change the directory ID "325" to match the ID of your newly created directory):