You can get the parent post parent first
$parent_post = get_post_parent($post_id);
You can then retrieve the permalink of the parent post with
$parent_post->url
or with
get_permalink( $parent_post->ID )
Related Posts:
- Debug whats going on inside a function called from AJAX
- Ajax filter with custom taxonomies
- Filter posts with ajax form and checkboxes
- How to save the checked boxes?
- Received nothing after executing AJAX post function
- AJAX load more for different custom post type loops
- Custom post type – use ajax to display sub pages
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- Load Next Posts With AJAX not working with custom post type
- WordPress notification if new post published
- passing values from functions.php to template
- Display custom-post type based on the Title matching the current selected value
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- How to submit the date with ajax?
- How can I create a button that when clicked populates a div with a list of foods that are checked as a certain type of ACF?
- Collect custom post in a calendar
- Submitting custom post from frontend,jQuery ajax, and custom validation – can’t find proper place to insert wp_insert_post()
- How do loop categories post from according in WordPress? is it impossible to solve this problem?
- List terms from Custom Taxonomy
- Click loads template via ajax
- Query Custom Post Types & category_name?
- Custom post type with file upload – need to “set as field” instead of “send to editor”
- WP_Query search posts by custom post type and custom taxonomy
- Display notification only once
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- How to retrieve the content (with a specific ID) via ajax by clicking a link tag
- Dynamic Custom Post Type Plugin
- Access/update database with jQuery
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- I am having a problem with form updating/editing WordPress post on the frontend
- How to filter out post type meta?
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- Passing jQuery value using Ajax to a page template
- How to make in WordPress admin panel sortable column for the custom field, that count the number of page impressions?
- Ajax form filter post by custom fields [closed]
- Display custom field of specific post where post title matches variable
- Conditional to modify query results
- How to load custom post archives sub-pages with ajax?
- Loop through posts of a custom-post-type (event) and create .ics (iCal) file?
- different template for first and second level custom post page
- Output custom post shortcode. Help spot the error.
- How to count custom post types with conditional operators
- ajax_object is not defined when ajax calls the function
- How to speed up admin-ajax.php in wordpress
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- GravityForm: Populate Dropdown with custom post type [closed]
- Return array of categories to php function for current post
- Returning a value from a PHP page
- Link users to a custom post type
- Create a random unique 6 digit number as custom field for custom post type
- How to output wordpress custom tags separated by comma?
- Loading all files within a directory
- Blog page showing same content as homepage
- Why is this Ajax not working?
- Stumped – Ajax Response Returns 0
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Colorbox ajax loading of outside HTML content works perfect on localhost but not on server
- Display custom post data in sidebar w/ dropdown
- Using several custom fields as custom post title
- Custom Post Type without an archive page
- Get rewrite slug of custom post type in template
- Show Different Header on a Specific Post ID
- Sending jsPDF documents to the server
- Get Post Primary Category
- Weird problem happening with custom taxonmy when creating/updating posts
- Use ajax from function.php
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- Ajax return code 400
- Filter categories of posts with checkboxes
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- doing an ajax request always outputs 0
- Admin notice not displaying
- Can’t get order_by meta_value_num to work properly
- Create custom post type on successful woocommerce order [closed]
- window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes
- Adding custom tables to WordPress
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Very Slow Page – How to Optimize # of Queries?
- Open div inside a custom post-type with Fancybox
- Dynamic page outside WordPress
- Using wordpress template tags within an array
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- How to test nonce with AJAX – Plugin development
- Custom query to filter posts that have current post as a taxonomy [closed]
- Custom post type permalink returns bad url
- Woocommerce add to cart quantity buttons with AJAX
- Return the thumbnail meta data for getter and setter
- class click counter save number
- How to display selected taxonomies by their parent
- Custom Field Order by Last Name and First Name
- Pagination for custom php code
- get_posts of Custom Post Type AND Custom Taxonomy
- Ajax Check Post Status
- What’s the difference between same wp functions get_posts(); functions in different form?
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- Checking for new message using AJAX and PHP. Server overload?
- AJAX request status 200 but no actual “response”
- Custom Post Type Loop throws 500 error when used in widget
- how to check if custom post type column already exists?