wordpress snippets last updated   : July 14, 2014
we now have 634 snippets

Return ID if parent page exists

wordpress snippet

This is a great little snippet that will let you return the ID of the parent page if the page has a parent. Just add this snippet to the functions.php of your wordpress theme and your ready to get the parent page ID.

read more

Display back to parent page link with get_post_ancestors

wordpress snippet

Adding the first snippet to the functions.php of your wordpress theme will display a link on sub pages back to the top level parent page. Place the second snippet within your theme in the location you want to display the link.

read more

Add parent page slug to body_class

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add the parent page slug to the body_class. Displayed like this <body class=”parent-PAGESLUG”> this can be a great way if you need to style elements on specific pages.

read more

Check parent ID

wordpress snippet

This snippet will allow you to check if a parent is a particular ID.

read more

First category ID of post

wordpress snippet

Adding this to your functions.php of your wordpress theme will allow you to get the first category ID of the current post when calling getParentCatID() from your theme.

read more

Get parent page title

wordpress snippet

Adding this PHP code to your wordpress theme will return the title of the parent page.

read more
jqsnipp.com | we just launched jquery snippets website