Archived topic
Little php error problem
2 replies · Started by Michal on February 7, 2018
hello,
I want to have custom content between comments. Something like this:
( https://wordpress.stackexchange.com/questions/251219/additional-content-every-x-comments )
I am trying to incorporate this functionality into generatepress theme but from an hour I can't find my mistake
I created a custom plugin, created 3 custom fields named 1,2,3 and then replaced
wp_list_comments( array(
'callback' => 'generate_comment'
) );
with
wp_list_comments( array(
'callback' => 'generate_comment'
'_inject_content' => [ get_field('1'), get_field('2'), get_field('3') ]
) );
What's wrong with my php code?
I added this code (which should show content between comments but then all comment section disapeared)
Thanks for any suggestions.
As long as get_field('1') are pointing to correct fields, I don't see anything wrong with your PHP.
I don't have a lot of experience with this specific functionality though, so I'm sorry that I'm not very helpful!
no problem;)