Skip to content

Instantly share code, notes, and snippets.

@barrykooij
Created October 17, 2017 13:56
Show Gist options
  • Save barrykooij/9e3b26aa8c7becb1a9ac7c61dafd2235 to your computer and use it in GitHub Desktop.
Save barrykooij/9e3b26aa8c7becb1a9ac7c61dafd2235 to your computer and use it in GitHub Desktop.
<?php
// Get the connected posts
$my_connected_downloads = Post_Connector::API()->get_children( "your-dlm-connection", get_the_id() );
// Check
if ( count( $my_connected_downloads ) > 0 ) {
// Loop
foreach ( $my_connected_downloads as $my_connected_download ) {
$download_obj = new DLM_Download( $my_connected_download->ID );
// Display the title with a link
echo "<a href='" . $download_obj->get_the_download_link() . "'>" . $download_obj->get_the_title() . "</a><br/>";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment