How to check if a Page is a Child of a Page in WordPress

This is a function that will check if a page is a child of a page in WordPress.

Add this on your function.php in your theme.

Usage