-
Author
-
March 23, 2015 at 13:10 #51157niljeParticipant
Hi,
searched a while now, but can’t find an answer.
I’m using ‘Content View Pro’ for the post layout. I would like to see the comment template after each post. I got that filter code from CV-Support:add_filter( ‘pt_cv_after_item’, ‘my_after_item’, 10, 2 );
function my_after_item( $args, $post_id ) {}
is there an easy way to get the original comment template with social share and everything what comes after the post into that code?
And can I set in general to see just 5 comments and a page-navi for commemts at the end of each post?
Best Regards,
DaniMarch 27, 2015 at 01:11 #51755AndreiModeratorWe’re using the default wordpress comments template which we have styled. This functionality that you requested should be provided by the author of the plugin you’re trying to use because it involves much more than a simple piece of code. I’m telling this because comments are mainly shown only in single pages, not inside a post listing.
Please let me know if I can help you with something else.
CheersHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionMarch 28, 2015 at 22:02 #51962niljeParticipantGreat, we could solve the problem
That’s the code it works perfectly with:add_filter( ‘pt_cv_after_item’, ‘my_after_item’, 10, 2 );
function my_after_item( $args, $post_id ) {
// get post comment
$args = array(
‘status’ => ‘approve’,
‘number’ => ‘1’,
‘post_id’ => $post_id,
);ob_start();
foreach($comments as $comment) :
echo($comment->comment_author . ‘<br />’ . $comment->comment_content);
endforeach;$social_share = get_template_part( ‘page-parts/posts-social-share’ );
// Change global $post
global $post;
$gpost = $post;
$post = get_post( $post_id );// Show comment form
comments_template();// Recovery global $post
$post = $gpost;$args = ob_get_clean();
return $args;
}I added this line: $social_share = get_template_part( ‘page-parts/posts-social-share’ );
But I just see the social shares like facebook, twitter etc… how can I put the ‘kleo-like-item’ into it?Thanks!
March 30, 2015 at 20:09 #52277AndreiModeratorI’m glad you found a way to deal with the comments template/form.
For the like item to show you’ll probably have to enable this feature from Theme Options, or from each post settings.Let me know if I can help you with anything else.
CheersHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionMarch 30, 2015 at 20:20 #52279niljeParticipantIt’s already enabled.. I see it at the single post pages too, but have to get it somehow into the ‘after-item’ filter of the post-layout plugin I’m using… I searched for the “$” and the path of kleo love item, but I couldn’t get it to work… like that, like I said:
$social_share = get_template_part( ‘page-parts/posts-social-share’ );
that works perfectlyor is there maybe a solution with both, social share and kleo love item and its called ‘after-content’ or something like that, saw something too, but doesn’t work…
March 30, 2015 at 20:43 #52281AndreiModeratorCan you provide a link to the page in which you’re trying to do all this, and also wp admin credentials and a ftp account ?
Looking forward.
CheersHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 4, 2015 at 22:46 #53264niljeParticipantHi,
short update, the links at the mainsite works again.
But I still don’t know how to get kleo love and social share into the add-filter-codeRegards
April 7, 2015 at 21:56 #53563niljeParticipantoh, now I see it’s “not a support question”? what does that mean?
I just don’t find the variable and path to create the code to put it into ‘add filter’, thought that would be easy for you to answer? I worked it out with the social share, but don’t know how to see ‘kleo love’ too, which is right next to ‘social share’ in the original.April 8, 2015 at 03:30 #53622AndreiModeratorThe likes feature resides in the same template/file ( posts-social-share ). The reason it doesn’t work is because the comments aren’t a wp post loop/query and that means that the likes can’t be assigned to a post id, and that’s the reason why they won’t show up.
Without some proper customization, you won’t be able to display them for each of your comments.
Let me know if I can help you with anything else.
CheersHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.