2 query in an array using my code

这一生的挚爱 提交于 2019-12-05 18:09:02

Not sure about my solution coz I havent WP host to test it, but rty something like that:

line 39: replace that line with this one code below

    <?php if (have_posts()) : while (have_posts()) : 
    global $post;
    if (!$first_time)  
    {
        $post_id = 6;
        $post = get_post($post_id);
        $first_time = 1;
    }
    else the_post();
     ?>

Solution idea is simple:

 Check for first-time loop
   :firt loop - simply get needed post with "get_post()" function
   :other loops - get posts from original query by "the_post()" function.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!