So right now the site automatically creates pages when a post is updated. I want this page to include an audio playlist. So what I do, is simply add the shortcode:
Then, when the audio files are attached to the page, the playlist automatically generates.
I can confirm that this method works with specified IDs.
The problem is, that 3 different pages are made, and I need the audio to be attached to all three pages. So my solution is that I make a another page, set the audio files as children to that page, and make the original 3 pages children of the new page. Then I could use the
[playlist] shortcode, but tell it to get the id from the parent page.
[playlist id="<?php get_parent_id ?>"]
or something like this.
The problem is that I cannot get the parent id. I've tried multiple different lines of code and nothing will work. The playlist just gets the default 0 ID, which it does when
id="" is left blank.
This is all going into the
functions.php file in my theme's directory.
Maybe there is a better way to do this, thusfar, this seems like the simplest solution, if only I can get the direct parent ID. It must exist.