Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach( $related_posts as $post_type => $post_type_related_posts ) {
- # This filters %posttype% from the title
- $title = MRP_get_title( __($options['title'], 'microkids-related-posts'), $post_type );
- if( count( $post_type_related_posts ) ) {
- $output .= "<div id="related-posts-$post_type" class="related-posts-type">n";
- # Create the title with the selected HTML header
- $output .= "<".$options['header_element'].">".$title."</".$options['header_element'].">n";
- $output .= "<ul>n";
- # Add related posts
- foreach( $post_type_related_posts as $related_post ) {
- $output .= "<li>";
- $output .= "<a href="".get_permalink( $related_post->ID )."">".$related_post->post_title."</a>";
- $output .= "</li>n";
- }
- $output .= "</ul></div>n";
- }
- # If there are no related posts for this post type
- else {
- if( !$options['hide_if_empty'] ) {
- $output .= "<div id="related-posts-$post_type" class="related-posts-type">n";
- $output .= "<".$options['header_element'].">".$title."</".$options['header_element'].">n";
- $output .= "<p>".$options['text_if_empty']."</p>n";
- $output .= "</div>";
- }
- else {
- # Show nothing
- return "";
- }
- }
- }
- $output .= "</div>";
- return $output;
- $output .= "<a href="".get_permalink( $related_post->ID ."">".$related_post->post_title."</a>";
- $output .= "<a class=" THE-CATEGORY-SLUG " href="".get_permalink( $related_post->ID )."">".$related_post->post_title."</a>";
- foreach((get_the_category( $related_post->ID )) as $category) {
- $output .= "<a class="$category->slug" href="".get_permalink( $related_post->ID )."" title="" . $category->cat_name . "">" . $category->cat_name . "</a>";
- }
- $output .= "<a href="".get_permalink( $related_post->ID )."">".$related_post->post_title."</a>";
- $output .= get_post_field('post_content', $related_post->ID);
Add Comment
Please, Sign In to add comment