WordPress comment and Recommendation block location, will be wrong
On the single.php page of WordPress
I would like to join a recommendation section. is to query a similar article based on the classification ID of the current article and then as a recommendation
But
PHP Code
If so, the page is not a problem, but the recommended article in the comments below the layout is not good to see
If I change into
PHP Code
The recommended article is on the list of comments, but the question comes. If you recommend it, the comment will be wrong.
For example: Read the comment is not normal, the comment is not the current article of the review, but into the current classification of the comments.
Comments_template (); It should be WordPress inside all the page, I will not write it out.
I'm pasting recommend.php source code.
PHP Code
$cat _id, ' showposts ' =>5); $my _query = new Wp_query ($args); while ($my _query->have_posts ()): $my _query->the_ Post ();? >
"alt=" "title="
"/>
/images/dummy.png" alt= "" title= "
"/>
"Title=" " >
In the source code, the Lima error occurs whenever a while loop or foreach is used.
I don't know what to do with it. The possible error occurs because the loop changes the ID: And then I don't know what to do.
------Solution--------------------
No, you have no problem with the code.