Last active
December 15, 2017 12:39
-
-
Save barrykooij/6b0a945c36e1ea54d7773482fad8f8dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Setup some data | |
*/ | |
// get the post type | |
$post_type = get_post_type( get_the_id() ); | |
// The settings object | |
$pt_settings = RP4WP()->settings[ 'general_' . $post_type ]; | |
/** | |
* Get the children | |
*/ | |
$plm = new RP4WP_Post_Link_Manager(); | |
$children = $plm->get_children( get_the_id() ); | |
/** | |
* @todo count amount of $children and fill up with manually set or random posts of current category | |
*/ | |
/** | |
* loop and display | |
*/ | |
if ( count( $children ) > 0 ) { | |
// Manager Template | |
$manager_template = new RP4WP_Manager_Template(); | |
// Load the template output | |
$manager_template->get_template( $template, array( | |
'related_posts' => $children, | |
'heading_text' => $pt_settings->get_option( 'heading_text' ), | |
'excerpt_length' => $pt_settings->get_option( 'excerpt_length' ), | |
'post_type' => $post_type | |
) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment