Roughly this:
$parent = get_post_field( 'post_parent', $id);
$link = get_permalink($parent);
Related Posts:
- using upload image with media_handle_upload .. but !
- Automatic image renaming based on title
- Automatically wrap post image in div
- sanitize attachment filename
- Importing media medium setting image gallery / image attachments
- Custom attachments styling in post view
- problem in uploading attachment to custom directory
- How to query details of images in gallery that is attached to a post
- Attach File Funcion for Common people
- Transferring theme and imported post attachments
- Is it possible to show related posts on WordPress attachment pages?
- Where are Additional CSS files stored
- What Is The Use Of map_meta_cap Filter?
- Localization: I want the backend: english and frontend in defined language
- How to get current_cat in navbar, in single post
- Need logged in users returing to site redirected to a separate page
- Widgets vs. Theme Mods
- wordpress custom walker for thumbnails with custom menu
- Custom sidebar category listing?
- Posts not showing with custom categorybase and subcategories [closed]
- How to fix broken upgrade to 3.1
- Disable email field on WooCommerce customer account details
- Add new Control to Customizer to modify Headings (h1, h2, h3…) Color
- Is there a filter hook that I can use to change how taxonomy term names are displayed?
- Custom Theme Blog page not showing Posts
- Gutenberg Blocks – Attributes from comment delimiter or from HTML?
- register_sidebar ‘after_widget’ on custom-built widgets not implementing, caused nested widgets
- Impossible to get Attachments Outside WordPress?
- Insert attachment ID in custom field from media uploader
- Limiting allowed html elements/strip harmful scripts from editor
- Displaying Post Attachment(s) at Top of single.php
- Can I develop a WordPress site without a domain?
- Customizing default Mediaelement player
- How to extend customize control types to list pages
- Add more then one site logo – custom-logo theme support
- Send a custom WooCommerce email when custom order change [closed]
- How to get rid of from overbooking car rental website [closed]
- Putting tag outside tag on generated Menu
- Advanced Custom Fields: Sorting custom columns with custom fields sorts only by date
- Custom static page get_header error
- How to encode author ID in the author permalink
- Oxygen builder custom Elements
- Multi Site installation inside a sub domain inside a sub directory
- how do I remove the shipping from woocommerce thankyou page and from the email
- Custom post type adds time/date and author to the post?
- Static admin page for all multisite users
- Using custom image resizing script in a page
- How to use default WP form elements to interact with custom DB table?
- How can I create a permalink with two categories, with the order based on the parent category?
- How do I add a promotional message to my posts?
- Customize option – add two image uploader under same section
- NextGEN Gallery – open all images on page in fancybox [closed]
- How to stop displaying the Id without losing the functionality
- Simplify the admin end
- Creating a shortcode by pulling in a custom field from a plugin
- Divi: how to hide/show specific menu according current page?
- “woocommerce_form_field()” function having issues after latest woocommerce update [closed]
- buddypress remove username from autocomplete
- When should I not use WordPress? [closed]
- Hide Customizer’s Widget Choices From The List
- How can i create menu like in the example?
- Custom Post Types database persistance. Why not?
- Can readers download zip files from WordPress sites?
- Edit specific text on a static page
- Customise the Category Widget
- Showing Meta Box via Jquery Checkbox
- custom user meta query
- Create new network instance, import old single installs AND keep the urls?
- Any Good WordPress Client Like Live Writer To Create Static Pages
- WordPress homepage hangs in IE browsers
- How to setup a membership system in WordPress?
- How can I resolve a .htaccess internal server error setting up a WordPress multisite?
- Don’t update modify time post on Quick Edit
- Style WooCommerce Product Search Widget
- Product page not found if product data is set Appointment Service
- Avoid showing the same phrase in the loops
- Why does a custom php code inside a custom template not get executed?
- wordpress custom posts page not showing
- Wrap WordPress Login Form in custom Div
- Automatically reject a comment if website field contains anything
- Custom permalink structure for posts in certain categories
- Replace publish date in blog module with custom field
- Need help with drop down list on the profile
- Hosing a website within a WordPress directory/folder
- Creating a dynamic URL for an external link inside content
- Child Theme – Changing Header
- Custom Single Template
- how to auto fille conatct form 7 when user is logined
- Creating WordPress staging environment software
- How to add H1 Tag on Homepage?
- Display popular posts by how many hits it got within 30 days of publishing
- How to use hook admin_init for add_action for custom post type column
- User registration add user ID?
- Can’t Auto-Update, but permissions are good?
- WordPress uploads directory. Featured Images storage
- WooCommerce customise checkout billing form [closed]
- Is there a way to have information on one page automatically feed into another? [closed]
- Upgrade to 3.1.1 Fails
- Disable all Fonts that are Standard in WordPress and replacing them with a custom Font?
- Custom Menu (only showing direct cildren) ACF not showing