I'm currently working with this wordpress theme and just created this function that adds my ads, share buttons and comment box to my post pages. However, i have some review posts on my site (you know, a rating system with stars or percentages) and this theme inserts this review box below the content of the post. So the review box will apear below the comment box and share buttons that i inserted with this function. I tried to insert the review box code in my function. Here's my function.php code:
function content_injector($content) {
global $wp_query;
$postid = $wp_query->post->ID;
if (is_single((get_post_meta($postid, 'top_ad', true) != 'off' ))) {
$top_ad = do_shortcode('[td_ad_box spot_name="Ad spot -- topad"]');
}
if (is_single((get_post_meta($postid, 'bottom_ad', true) != 'off' ))) {
$bottom_ad = do_shortcode('[td_ad_box spot_name="Ad spot -- topad"]');
}
if (is_single()) {
$review = //WHAT CODE DO I ADD HERE?
$custom_share = '<div id="title-deel"><h4 class="block-title"><span>DEEL</span></h4></div>' . do_shortcode('[ssba]');
$facebook_comments = '<div id="title-reageer"><h4 class="block-title"><span>REAGEER</span></h4></div>' . '<div class="fb-comments" data-href="' . get_permalink() . '" data-colorscheme="light" data-numposts="5" data-mobile="false" data-width="700"></div>';
}
$content = $top_ad . $content . $review . $bottom_ad . $custom_share . $facebook_comments;
return $content;
}
add_filter('the_content', 'content_injector');
The post pages are constructed with this code located in a file called td_module_1.php (i left out the upper part of the file because it's not relevant):
} else {
$buffy .= $this->get_content();
}
$buffy .= '<footer class="clearfix">';
$buffy .= $this->get_post_pagination();
$buffy .= $this->get_review();
$buffy .= $this->get_the_tags();
$buffy .= $this->get_source_and_via();
$buffy .= $this->get_social_sharing();
$buffy .= $this->get_author_box();
$buffy .= $this->get_next_prev_posts();
$buffy .= '</footer>';
$buffy .= '</article> <!-- /.post -->';
$buffy .= $this->related_posts();
return $buffy;
}
}
As you can see the line $buffy .= $this->get_review();
inserts the review box. The question here is, what code do i need to add after $review = to have the function insert the review box? I already tried things like $review = $td_module_1->get_review();
It should be possible to get that get_review function to work in my functions.php, right?