Provide zblog template_zblog them_wordpress template download and customization

Wordpress calls multiple classifications to generate the code of homepage cms layout

Tianxing Studio 2019-12-16 20:39 Wordpress Tutorial one hundred and four thousand six hundred and fourteen 0 Comments


The cms layout of wordpress home page needs to call multiple classified content. At the beginning, this code was borrowed from another topic. It uses the while loop, which I am not used to.

Later, I copied the foreach loop of zblog directly. I don't know whether it is correct or not. It works anyway ..

Share it and participate in politics with each other.

 <?php $themecateid = '1,2,3'; $flids = explode(',',$themecateid); foreach ($flids as $cid){ ?> <?php <ul> query_posts('posts_per_page=8&caller_get_posts=1&orderby=rand&cat='.$cid); while (have_posts()) : the_post(); echo '<li><a href="'.get_permalink().'" title="'.$post->post_title.'" target="_blank">'.$post->post_title.'</a></li>'; endwhile; wp_reset_query(); </ul> ?> <?php } ?>

The "1,2,3" of the above code is the classification ID of the call, and the while loop is still used for one layer. Html code structure can be adjusted at will.


Can't find a tutorial that can solve your problem?

You can try to search or ask questions directly online. We also provide charging technical support. If you need it, you can contact us online.

Online questions Online Service

welcome you Comment: Cancel Reply

 Please fill in the verification code
  • Latest articles
  • Hot article ranking
  • Most Comments
Label aggregation