Let's have a personal and meaningful conversation. Top Source File: wp-includes/class-wp-query.php . How to standardize the color-coding of several 3D and contour plots? Here well look at the bare-bones PHP code that makes up The Loop. Elementor Post - Loop Grid error | WordPress.org When there are no more posts, The Loop will stop, and the page will move on to the next thing in this PHP template. V chng ta s lp thng qua phng thc have_posts() trong i tng $wp_query. but I'm not sure what to add to the following code to make it happen. Some template files are very little but The Loop. Putting the above code after the last post in the loop would have resulted in the output of the get_the_ID() function being the ID of the last post. I just dont want to show in the loop the most recent post published under Podcast simply because its already featured with its own styling. Get Inspiro Premium. Thing is, Ive a blog that publishes podcasts. wp-admin/includes/class-wp-media-list-table.php, wp-admin/includes/class-wp-posts-list-table.php, You must log in to vote on the helpfulness of this note. Find centralized, trusted content and collaborate around the technologies you use most. Ths $post->ID gives me the page id not the post id so thr wrong number is being outputted, how do I get the post ID? If not, then our PHP engine skips right over The Loop, because theres nothing to loop through! Heres how that works, line-by-line: The Loop first asks of the broader WordPress environment, Have any posts been fetched for me to process? It asks this using a WordPress function called have_posts(). If you want to learn basic PHP coding for WordPress, check out our free course. So taking some Posts from the blog of our site Press Up as examples, the Loop above outputs: A couple of things to notice in this Loop example: If you made a theme whose only template hierarchy file was index.php, and pasted the above Loop into that index.php file, it would work. In fact, in the source, it goes right from Post Title to Post Date, and gives no indication that there ever should have been Post Content in there. Note: Adding this code to your WordPress files can cause issues with pagination on your website. Once youve customized and saved the file, you need to upload it to your theme directory in your WordPress hosting account.