Skip to main content
3 of 3
added 253 characters in body
metalzade
  • 117
  • 1
  • 2
  • 5

How to get the post's parent ID?

I have a template which outputs the blog posts (Blog Page), I open one of the posts which use single.php template, Now how can I get the ID of it's parent which is the (Blog Page)?

I should say that I want to use this ID to get the meta box value of the blog page in single.php.

The same goes for a custom post type, let's say 'project', Where a page template list the project's posts (Projects Page) and single-project.php for the single project post. in this case I want to get the (Projects Page) ID in single-project.php.

metalzade
  • 117
  • 1
  • 2
  • 5