As always, people copy paste whatever they learned from and IIRC the first style is the coding style of wordpress core.
As you said yourself, when there is a big block of generated HTML it is easier to look at (and balance tags) under the first style, but pragmatic people will use the second whenever that is not the case.
It is really just coding style preference nothing technical behind it.
Related Posts:
- What exactly does “Posts page” do in WordPress?
- Blank on static home page?
- Blank space at beginning of tag?
- An unwanted inline style is added to my body tag
- How to properly insert a link to a template in WordPress?
- Creating custom page template from existing PHP site
- What are the advantages/disadvantages of ways to use php template files?
- WooCommerce – Print Processing orders [closed]
- Custom search results page not working with empty search
- WP grandchild categories in nested ul li
- I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php
- Use DOMDocument with ob_start breaks my HTML code
- How to show single category archive
- code is skipping a div
- Issues getting PHP to display in category pages
- How to change redirection route to a php page for making it only accessible by logged-in members?
- selected option if current category is the value
- Change title only in dynamic page
- How to remove ?wp-mce-4103-20162941
- Customize position of social icons in upme plugin [closed]
- Why Won’t My Inputs in a form with a Get method work together?
- parts of url disappear when using # inside href=”” [closed]
- Settings API callback function inserts html quotes from nowhere
- Input data from email form not going to JSON file
- How to get the value of input hidden html from text editor to custom page template?
- Secondary navigation menu on one page
- Enable custom logo upload if logo is not in header
- Different post styles depending on category
- How create a Shortcode with hover and complex options
- How do I remove the product thumbnail link from a specific div in Woocommerce? [closed]
- Dot is not added at the end of href
- WordPress Multiple Navigation bars
- Position banner to right of logo in header – messed up my header file
- Commenting out unwated CSS/scripts in HTML with PHP
- How to separate HTML and WordPress files
- Add .htm extention to a custom taxonomy
- How can I edit the content in index.php? [duplicate]
- Login to wordpress by clicking a link and specifying usernaname and password in url
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Woocommerce Show Single Product on Homepage
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- how to show only specific category for a template
- Show a different code on front page to other pages
- Make PHP work with HTML tags
- Does wordpress templates always in files or in database?
- Is there any tool to find lines of codes responsible to generate front-end HTML elements?
- Noscript not working as it should in wordpress site
- Can’t print Yoast meta description into page template (syntax error, unexpected ‘.’) [closed]
- Show latest posts in a plain HTML website custom widget [closed]
- Using same variable names in files added with get_template_part()
- How to convert select to HTML with PHP tags inside of it [closed]
- PHP include is only working in certain places in my custom WP theme
- Use WordPress function in php file
- Adding wrapper elements in the_date() like in the_title()?
- Is this spyware on my site or a real Java update?
- How to get all author posts outside of author templates
- Syntax error when I try to insert my loop into an unordered list? [closed]
- Add filter multiple times using only one master function
- Create a Blog Template Page
- Showing latest post without 301 redirect
- How to make modifications only to certain elements of an HTML string on the server-side?
- Wrapping a Sidebar within
- WordPress template page name displayed on screen
- Search WordPress using static html page
- Hide HTML element (by class or ID) with PHP
- Is there a way to hook or call a custom woocomerce template that is not part of the default templates of woocommerce?
- Add Codepen animation as Preloader to WordPress
- Path for php file for inserting data through html form
- Function returns text instead of html [closed]
- Printing HTML codes
- Widget back end radio button issue
- HTML escaping data with ajax requests
- single.php with different look by category
- How i can get post data from database when i am getting post id from url in wordpress
- How to retrieve the data from the sever and displaying it in a page?
- php within html within php
- How to execute html code inside php?
- How to call multiple functions from multiple files into a WordPress page template [closed]
- How to remove coupon dropdown feature
- Add data-id attribute to child page links
- Add shortcode in my div
- How do I define a lookup table that will work across all PHP elements of the template?
- persist a variable set in header.php all the way down to footer.php
- WordPress plug-in for dynamic download link?
- HTML table attributes ignored
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- Removing WordPress Footer -without access to PHP code?
- How to set a template with wp_insert_post
- Why is a wp function used in current PHP namespace’s callback not resolved to global scope?
- php esc_html_e with an html link inside not working
- Add html link in functions.php files of the theme
- Using ob_start and ob_get_clean with wordpress shortcode
- Why does the Woocommerce grouped template prints the unpublished products?
- Adding conditional text to a PHP Shortcode Template
- Create page template via functions.php?
- How to edit HTML of my website on WordPress? [closed]
- WordPress wp-admin redirect and exception
- How to remove the h6 tag for the entry-category Class
- Override user-edit.php to design own profile page