The double colon in this case is part of the alternative syntax for control structures.
That’s not the ternary operator.
You could also write instead:
if ( have_posts() )
{
while( have_posts() )
{
the_post();
the_content();
}
}
I prefer the second style, most code editors enable automatic folding with it, so I can close parts I don’t need to see.
Related Posts:
- How to get URL of current page displayed?
- What is This esc_html_e() i wordpress php?
- Build a content and excerpt grid loop with paging and options for # of posts
- How to loop over custom fields in a page template?
- How to change post count in wordpress loop?
- How can I loop into two different DIVS without repeating the DIVs
- Store loop into array
- Looping through WP_Post Object
- WordPress loop specific thumbnail size
- Show Custom Taxonomy Title
- How to exclude specific category from the get_the_category(); array
- How can i display post loop in table format?
- spliting posts into two columns
- How to speed up a wordpress function with multiple loops?
- How to select WooCommerce products by post_meta and order them
- How to Display a Single Post Excerpt
- $wpdb->flush(); breaks the loop
- Use object in template part
- Get first URL from post content
- Changing layout with wp_customise
- Show css depending on activity type in BuddyPress activity-loop [closed]
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- Iterate through posts based on array of categories
- get author_name from queried post
- How to add condition in wordpress loop? [closed]
- Alert Bar section within WP loop is displaying even though there are no posts
- Load wordpress content in other domain
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- post thumbnail, conditions, else wont work
- wp_query get the 2nd post
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- How to add div blocks after certain set of post
- How to avoid duplicates when creating recent network posts
- Why in my theme I can’t see all the statics content under the posts?
- How do I remove a category from a wordpress loop>
- variable value disappears in a second loop
- How to unlink all posts from tracking same amount of views
- Why my loop isn’t working? [closed]
- WordPress loop by meta key that is an array? and how loop multiple arrays
- Problem with custom loop and wp_list_pluck [closed]
- Display child page content of a specific parent on home page
- How to wrap every 3 posts in a div (and close the last div too) [closed]
- Dividing the loop to style post differently
- WordPress loop is not working
- Echo array value
- First post article different on Archives template
- How to add title attribute to archive items
- Strip from or something better?
- How to break up php code to avoid echo
- Problem in replacing the_content with the_excerpt()
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- Products listing check if meta checkbox is checked
- in_array not working on dev server but works on localhost
- How to Create Carousel Indicators in PHP Loop using wp_get_attachment_url function?
- Get title of page containing post grid within the posts
- Is there anyway I can call the year once?
- Display all categories including sub categories under a list ul
- Foreach Loop Of Post Types With Nested If Else If Not Completing Process
- Where does php code to load data go?
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- cURL needing to loop through all “next_page”
- Display page content in different sections – based on page break block?
- Filtering custom posts by using checkboxes for taxonomy in an ajax loop always gives server 500 error
- Latest posts feed with a specific post always first
- Show the subcategory name based on current product
- How can I get my pagination loop to display the correct number of total pages?
- How do if all posts has this category ID then do this
- ERR_TOO_MANY_REDIRECTS / To Force SSL Logins and SSL Admin Access
- View tag description on page
- Get current_post in reverse order with pagination
- How fix error in the WordPress loop?
- Efficient way of querying for a “fallback” post?
- Insert div after every three posts in home.php [duplicate]
- Display product attributes for current product
- Div Missing In Custom Loop Query
- Loop 1 user randomly
- Create a hierarchical loop at predefined markup requirements
- enumerating custom taxonomies?
- Using page template to fetch posts in page
- Create Customization Controls from Array
- ACF loop and php formatting
- How to display thumbnail if post is assigned one otherwise not
- How to have post count after each listed category
- How can I put a custom field as the link of a button shortcode?
- Transient Loop Not working as expected
- Custom Meta Box If Else Statement
- Adding if statement to content for homepage
- Tables not showing divs and loop/php items
- Conditional in foreach loop is outputting content twice
- Alternative loop syntax error [closed]
- Pagination in category.php not functioning
- is there away to hide php code in wordpress not to show in PAGES
- How to handle parent and child pages?
- How to create a loop that will display one post and stop?
- Woocommerce linking variations
- How to use a conditional statement in a post loop but not count towards the “posts_per_page” if false
- Saving meta box data from selected option’s value in database is not working
- How to show correct td of table tags in wp_query loop
- fetch from an external api call and display results in page
- How could I prevent using the same custom loop in a template file when I only need to change one meta_query parameter?