shortcode execution when the page is opened

No, shortcodes do not work this way as they are parsed on the server-side and replaced with the relevant content before the page is sent over to the visitor’s browser. What you could do is to place the shortcode within a hidden element (like a <div>), then have JavaScript/jQuery unhide the hidden element’s content when … Read more

How do loop categories post from according in WordPress? is it impossible to solve this problem?

Thanks all for help here the link about solved it bcworkz (@bcworkz) 37 minutes ago There are two issues I see. $cat_array is an array of IDs, not objects, so the ‘cat’ query arg should just be ‘cat’ => $cat, The other is when you use setup_postdata( $post ), you must explicitly declare global $post;