WordPress custom function error. for help, thank you for your help. I want to make an article recommendation for each article based on the classification of the current article. the code writing function below is implemented, but there is a very serious problem, the comment has a problem. after the following code is added, the comment on the article becomes a classified comment. every article is, in addition, an error occurred while customizing the PHPcode WordPress function on other pages after the review. for help, thank you.
Wordpress for some help.
I want to make a recommendation for each article based on the category of the current article,
The code writing function below is implemented, but there is a very serious problem, that is, the comment has a problem,
After the following code is added, the comments to the article are classified comments. each article is classified, and the post-comments are changed to other pages.
PHP code
Cat_ID. ','; // The ID of the current article category // echo $ category-> cat_name. ''; // name of the current document category} $ my_query = new WP_Query (" cat = ". $ cat_id. "& posts_per_page = 5"); while ($ my_query-> have_posts (): $ my_query-> the_post ();?>
"Alt =" "title ="
"/>
/Images/dummy.png "alt =" "title ="
"/>
"Title =" ">
------ Solution --------------------
PHP code
$ Cat_id. = $ category-> cat_ID. ','; // The ID of the category of the current article
------ Solution --------------------
"Changed to classification comment "?? Or is it the last recommendation article comment for you? After the comment, I jumped to the article?
Check whether your $ id is changed by the loop you added.
Discussion
Wordpress for some help.
I want to make a recommendation for each article based on the category of the current article,
The code writing function below is implemented, but there is a very serious problem, that is, the comment has a problem,
After the following code is added, the comments to the article are classified comments. each article is classified, and the post-comments are changed to other pages.
PHP code
// Recommended articles
?>
$ Cat_id = ""......