You can try get_post($post->post_parent)
or get_page($post->post_parent)
so if you do:
$parent = get_post($post->post_parent);
You can get the title like this:
$parent->post_title;
And anything you want, you can var_dump($parent)
to see all the post info you can use.
Related Posts:
- How to get posts published between a date and today?
- the_author() returns empty string
- How to display posts by current user/author in a custom page template?
- post_name empty after wp_insert_post
- Query posts distinct authors
- How to get previous 10 days post from a specific date – WP Query
- Query only Posts from Both of Two Category?
- Insert custom div between posts
- Can’t show comments count per post outside loop
- Only display posts with comments
- How to Display Post View Count
- Different amount of posts on homepage than paged pages
- How would I get 1 latest post from a query for 5 posts?
- Filter Posts By Tag
- Can I set and show “important” post in my blog?
- Exclude posts with empty post_content in wp_query
- previewing my posts on static page?
- Exclude newest post from category X but show rest
- Reset Popular post query?
- is there a way to show the the post title after the image?
- Display posts with tag that matches current post title
- Why is querying posts messing up my pages?
- Category Foreach keeps looping?
- Blog post per page setting conflicting with custom WP_Query?
- How to exclude latest x posts from a paginated query?
- Display an author’s posts on his own author page
- Multi row post list
- posts_per_page option limits the number of Gallery items
- How to make multiple sections in home pulling posts category wise?
- wp_posts table: safely remove unused columns to save database storage
- Query Posts by Custom Field
- Display Posts on Custom Page
- How to get posts from a current post’s month?
- Wrong post title displayed from loop
- While loop articles – if statement order
- Conditionals if tags exist?
- Get the amount of posts on a current page
- Posts – display all posts except a post by an ID
- Counter is skipping post when I still want it visible [closed]
- why the same code got different results when using query_posts in functions.php and index.php
- Archive template combined with post slider and regular posts
- How to get posts published on the latest date?
- How to only publish posts with image in it
- Post Filtering by GET URL parameters
- wp_query with ajax
- WP_Query: Show 10 posts in date order, first three random
- Custom posts listing widget always returns 1 extra result
- Get post by tag
- Random posts that always include a particular post?
- WordPress post filter menu
- Bootsrap carousel for post
- Get postlist for each category using query_posts?
- How to save posts position on homepage after random function?
- Echo the number of posts being displayed
- Exclude a category of posts in author template
- WordPress displays post on subcategory only
- Trying to query all posts in category 4
- Get posts from current category?
- Change content off every sixth element
- query for filtering published posts?
- AWS usage queries
- Pull in posts using post meta for REST API
- get posts, run a custom query, and join the results
- Show posts from two specific category in WP_Query
- How to create loop of posts except post ID defined via ACF field
- Displaying all posts from other sites on the network on one site
- How to fetch courses in all languages in WordPress?
- Multisite how to display merged posts from two sites and sort by latest date?
- How to show post views shortcode data for each post on Posts List Page?
- How to display particular categorie’s post which associated to specific user?
- Assign a day of the week to post, e.g: Assign Monday to post and have it only appear when the day is Monday
- Show 5 posts and than 3 posts offset with pagination
- WP_Query to get posts in a specific tag or has post_format
- Make recent post display recent updated, instead of recent published
- Manipulate query to show specific post
- How to correctly escape data
- Blog posts not displaying on blog posts page
- Sort Events by Venue Title – Sort Post set by related post ids
- Get posts by category or author
- Sort / Filter Queries
- get_page_by_title() not working if special characters are present
- Modify WordPress loop after it has been run
- get “read more” with custom DB query like you would with WP Query
- Ordering posts alphabetically by meta keys and title
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- How do I control the fallback query after the original query returned cero posts?
- Remove duplicated posts in the loop if post has more than one category
- How to pass multiple checkbox values to wordpress query?
- Adding a category at even positions on main loop with modified pagination
- How to get all post titles starting with numbers and symbols?
- How to inject a post within a loop
- How to get alphabetic listing x other posts, based on first letter post?
- wp trim function not working
- Change from all posts to specific categories post on main page?
- query_posts different amount of posts per page [duplicate]
- Count words for all posts by all authors
- Word count for all posts of all authors
- Do I need to create a multisite for querying posts from multiple WordPress sites?
- Sort Posts Alphabetically Based on Specific Category (Divi)
- How to change url of posts?