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 three thousand five hundred and eleven 0 Comments


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

Then I copied it directly zblog Foreach loop, I don't know whether it is right or not. Anyway, it can be used

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
  • Sign in
  • Registered account Forgot your password?
  • register
  • Already have an account? Direct login Forgot your password?
  • Social account login