WordPress Custom Function error, ask for help, thank you

Source: Internet
Author: User
WordPress Custom Function error, ask for help, thank you
WordPress seeks some help.
I would like to give each article under a classification according to the current article to do an article recommendation,
The following code function is implemented, but there is a very serious problem, that is, the comment has a problem,
After adding the following code, the comment to the article becomes a category comment, each article is, and after the comment the article becomes another page

PHP Code
  
   
  
   
  
   cat_id. ','; The ID of the current article's classification is    //echo $category->cat_name. ' '; The name of the classification of the current article} $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. ','; ID of the classification of the current article
    ------Solution--------------------
    "Into a classified review"?? Or has it turned out to be your last recommendation article comment? Did you jump to the article after the comment?

    Check to see if your $id is changed by this loop you added.

    Explore
    WordPress seeks some help.
    I would like to give each article under a classification according to the current article to do an article recommendation,
    The following code function is implemented, but there is a very serious problem, that is, the comment has a problem,
    After adding the following code, the comment to the article becomes a category comment, each article is, and after the comment the article becomes another page

    PHP Code

    Featured Articles
    ?>


    $cat _id= "" ...
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.