Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

What is the best approach to try to understand WordPress?

Because after ten years, it's about time I did...

         

ronin

6:56 pm on Feb 21, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What is the best approach to try to understand WordPress in a weekend?

In the 2000s I was aware of but mostly ignored WordPress.

In 2012, WP had become so prominent and widespread that I thought it was about time I got my head around it.

This won't take long, I thought - one of the CMS' greatest selling points is supposed to be that it's easy for non-technical people to get their heads around it. So how much easier will it be for someone who has a modest familiarity with web technologies?

Nope.

I couldn't get my head around WP in 2012.

I looked in on it several years later - maybe 2016? - and still felt completely daunted by it.

I find WP terrifyingly complex and utterly unintuitive. How non-technical people can so easily embrace it is utterly beyond me.

I actually did some professional work - mercifully briefly - on WP in Sept-Oct 2018. I could still barely understand it.

Separately, between late 2018 and early 2021, a friend wanted me to analyse his WP setup, diagnose why it was slow, buggy, badly optimised for search, not integrating properly with social, vulnerable to attacks etc.

Honestly? I looked at the setup numerous times and never dared touch anything. Every time I looked at WP I left more daunted than I had been before.

Things that leave me utterly lost when it comes to WP:

- Why does it have a database? Why does it have to have a database?
- What are themes, really? Why aren't they just CSS files? What else is going on? Why do I have to have a theme?
- Why are plugins necessary at all? (Maybe they're not, but I don't think I've ever read a sentence which includes the words WP and SEO and doesn't also include the word Yoast)
- Why does adding more plugins slow WP down? What's going on here?
- Why are there caching plugins? Is caching necessary? If so, why?
- What is going on with all this page / post stuff? Why I can't I just create a new page and add HTML to it?
- How on earth do I edit CSS?
- How do I edit the <head> of a page?
- Why can't I just create a new page and associate it with a CSS stylesheet and a JS file? What the damn hell?
- Why is the PHP soooo complex. I use PHP a lot and I like PHP... but some of this... I can't begin to understand
- Why is all the PHP and HTML all mixed together like a big ball of mud? Who writes stuff like this?
- If I find all this stuff so difficult to get my head around, how come the non-technical people find it so easy?

And probably a hundred more questions...

It's just so horrendously messy and complex and unfathomable and... and I can't look at anything in View Source and then know where to find it in the codebase... or even know how to know where to find it in the codebase.

I'd be delighted to find a WordPress in One Weekend course so that, if I have a weekend spare, I can sit down and dedicate that entire weekend to learning WP and feel like I can actually drive it, by the end of that 48 hours.

I keep reading that non-technical people can pick up WP in a couple of hours, so I think the above ought to be possible.

I have to get over my utter incomprehension and bafflement with regard to WP.

lucy24

7:04 pm on Feb 21, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Why does it have a database? Why does it have to have a database?
Because the pages don't actually exist; they are built from scratch on every request, using text stored in the database.
What are themes, really? Why aren't they just CSS files?
Because the term “CSS file” would frighten the user. Tell them it’s a “theme”, and they won’t notice or ask why a single page calls up to thirty separate stylesheets. (Back before I got tired of counting, I think the record was 31.)

If I find all this stuff so difficult to get my head around, how come the non-technical people find it so easy?
Because they, unlike you, aren’t trying to understand what is happening under the hood.

Edit: Something that may or may not help as an analogy. When I first went to college, there were two different tracks of calculus: the “real” version, and a dumbed-down version meant for people in non-STEM fields who were afraid of math. The ostensibly easier version was actually much harder, because they just had students blindly memorize things like “the derivative of x^2 is 2x” without ever explaining what a derivative is. It’s only “easier” if you start from the premise that the user cannot understand anything anyway, so just follow the instructions and click the buttons.

not2easy

7:27 pm on Feb 21, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Some of these puzzles are merely different words/names for things I'm sure you work with all the time.

A "page" and "post" are merely templates for different purposes.
A page is generally a topic and posts are news, ideas, points, details about that topic.

Plugins are used because they are easier than actually learning.

There are so many settings, i have some WP sites that use no posts at all.

The theme is basically a look, a skin. It can certainly be edited. I have used the same theme on several WP sites and none of them look like the original.

I agree with lucy24' explanations, she is right about most of the people using WP - they could not create a page for a site any other way and they don't try to understand it even enough to take basic site security precautions. Its use is so widespread it is a primary target for all kinds of bad players. So they build a new site tomorrow.

The Yoast plugin is because WP was not created to be SE friendly and offers the same content half a dozen different ways. I am not surprised that it is confusing to a logical thinking person. It isn't logical, it is magic.

Sgt_Kickaxe

7:01 am on Feb 23, 2022 (gmt 0)



Wordpress is best described as a frustratingly bloated mess of generic helpfulness. For a web novice it's a good start.

Once you master wordpress you'll use it to create static pages and little more. It's great for interlinking existing pages which would be tedious to do manually. I can't speak for anyone else but I've yet to see a wordpress based competitor I can't smoke in rankings with my custom static pages + flat file database setup

Eventually you'll just go old fashioned HTLM for your own stuff if nobody else needs to work on the site too. By then you'll also have mastered htaccess but be patient, it's a process and wordpress is a big part of it for many. Keep tinkering my friend.

tangor

11:37 pm on Feb 23, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Odd thing about WP is that it actually works, for just about anybody.

Drink the kool-aid and enjoy the magic. :)

On the other hand there are some good aspects of WP that can be quite useful if one likes to tinker (and eviscerate the parts you don't need), just remember that each upgrade might reintroduce things!

Sadly, the current uptake by "webmasters" around the world makes WP a tempting target for the bad actors.

I can use it ... but only for those who demand it. I personally do not have it on my sites.

WP is a mouse designed by a committee and looks very much like an elephant in final form.

lexipixel

12:27 am on Feb 24, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




Here's a couple under-the-hood hacking tips ---

1. Use two browsers that don't share cookies (or two different devices if you have em). Only be logged in on one of the browsers or devices as "admin", (so you can use the other one to see what a "user" would see if they viewed the site without "admin" privs.... being logged in as admin adds a huge amount of code to any page you look at).

2. Find the template files, (e.g. /wp-content/themes/twentytwentyone/index.php", "single.php", "archive.php" etc) and near the end of each add following code (with actual file name) --

<p>FILENAME: example.php</p>

This will let you know which template WP used to produce the output you're looking at --- that's half the challenge -- I've seen people struggle for days only to find they have been attempting to modify a template or CSS referenced in it and that was NOT the template used to output the URL they requested....

See: [developer.wordpress.org...]
and: [developer.wordpress.org...]

lexipixel

10:47 pm on Mar 10, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



WP is a mouse designed by a committee and looks very much like an elephant in final form.


Definitely agree.

If you think about it, Wordpress was originally released as a "simple" blogging script. It did one thing and did it well. It allowed "bloggers" to write a post and would then allow others to read the blog (and reply to the posts). It was simple, it did one thing and did it well.

Like any other mature software, the core is still there -- they can't get rid of it, (like DOS living under the hood of Windows).

With that said, I think it's easier to understand WordPress is you think about it's original core functionality.

    Author writes a post and clicks the PUBLISH button.

    User visits website and sees the post on the home page.

    Author writes / PUBLISHES another post.

    User visits site and sees newest post, followed by older post.

    author continues adds several more posts to blog.

    User visits website and see (5) Latest Posts followed by a "View Older Posts" link.


,.... that's all... WordPress was a "loop" that basically did a query on the posts database table and returned "up to X number of posts" and if there were more results than the limit, wordpress would put up Older / Newer navigation links.

Jump forward 20 years and every bell and whistle someone ever wanted to add to Wordpress still has to follow the same logic, (known as "The LOOP" ... see: [codex.wordpress.org ]

Understanding the entirety of WordPress is not possible (if for no other reason than that is is constantly evolving software).

Here's a link that helps understand how a theme's template files affect output ---

The Anatomy of a WordPress theme
[yoast.com...]

... the most useful thing I find in using WordPress is that you can change just about anything it does, or write a plugin to do anything it doesn't do with native functionality. Having it handle user management, ecommerce (Woocommerce is now owned by Automattic publisher of WordPress) and the endless supply of the responsive themes lets me concentrate of content (and plugin development when I can't get the core to do what I want).

I am surprised at the dearth of WordPress posts here on WebmasterWorld... with 40% of sites running WP, it's a huge segment of the web to not "master".

TorontoBoy

1:16 pm on Mar 12, 2022 (gmt 0)

5+ Year Member Top Contributors Of The Month



Wordpress is very easy to use to write content and publish. This is why it is so popular. I put rank beginners onto WP and they thrive. The writing UI is pretty good and does not detract from the actual act of writing. Regular people do not get put off by the technicalities of web technology.

From humble beginnings the platform has mushroomed into a huge and complex mess, and is ripe for hacking. You need not participate in the mess. Core functionality is still quite good. For those that don't quite understand coding, this can get them into a huge amount of trouble. Instead of making simple coding changes in the theme, or on an individual page, they search for a plugin. Plugins are the technology crutch that most users lean on. Plugins then proliferate and bloat the site, while adding to the security risk. From there it is all downhill. With great flexibility comes a great power to mess up your site. Themes and plugins are largely not reviewed, and many are badly written and can be hacked. WP also requires regular maintenance for core and plugin functionality. Plugin writers disappear and their plugins then can become a security risk.

That said, I still do love WP and use it daily. Simple is better. While writing content is easy and convenient, this does not mean you can get rid of your tech person and DIY everything. Most people will quickly get into deep trouble. WP is a p*ssycat on top but can be a vicious tiger underneath.

Sissi

8:26 pm on Mar 12, 2022 (gmt 0)



WP is like IKEA it s simple and complex at the same time.
I m happy without and feel so free not depending on a tool that can make my sites vulnerable to any technical event.

Dimitri

2:17 pm on Mar 13, 2022 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



Peace first, then ...

@ronin, you are thinking too much.

What are you trying to understand? How WP works, or how to use it?

What is your goal? Do you want to be able to use WP, to publish content, but at the same time be able to customize it as you want?

ronin

9:51 am on Mar 14, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Excellent questions, @Dmitri, thank you.

I am trying to understand the mentality behind the design decisions in WordPress, so that I might adopt it in a project, if and when I ever might need to / should I ever need to.

The alternative is regretfully resigning myself to the present in which WP remains a tool utterly beyond my comprehension: a tool I find impossible to use, because I cannot begin to comprehend it, systemically, at even a relatively basic level.

Most WP users (I imagine) don't ask why it uses a database. That would be my first question: why does WP use a database? Why must it use a database? I can understand being able to include a database as an advanced option. I can't understand making the database obligatory.

(N.B. I'm certainly not going to argue that databases aren't useful. I acknowledge they are hugely advantageous when it comes to concurrent CRUD (Create / Read / Update / Delete) processes. But In 25 years of writing static web pages, static web sites, dynamic web sites, PWA (progressive web apps), single page apps and Electron-based desktop apps, I have never yet had call to deploy a database. I'm fully open to the possibility that one day I will - but I'm not inclined to deploy one simply for the sake of it).

This database question is usually my very first question. It's so fundamental it tends to haunt me intermittently at the back of my mind even while I'm dealing with everything else in and around WP.

Then, my next question (in a very long line of questions) which speaks to the way WP is architected:

If I'm looking at a (non-WP) web page and the font-family for the main heading is Courier and the background-color for the document body is dark blue and I want to change the main heading font to Verdana and the body background-color to a darker blue, I will identify the correct CSS file to make changes in, open that file, make the changes and save. If I'm already aware of which CSS file I need (and I likely will be) this is a 3 second process.

But if I'm looking at a WP page - and I've attempted similar processes more times than I can count - it does not seem clear to me how I can simply locate and open a CSS file, edit it and re-save it. I'm not saying this is impossible - but I've never yet found a way to do this. I've tried and failed so many times that it occurs to me that it might be impossible.

At this point I almost completely lose the ability to understand what exactly it is that I'm working with.

Outside WP, editing a CSS file couldn't be more elementary. What is the thinking at WP behind making this process more convoluted and / or more difficult? I absolutely understand that a lot of WP users will not want to deal with CSS syntax. That's fine. I'm certain there are plenty of user-friendly, non-technical approaches can be evolved to assist those who don't want to manually edit stylesheets. That makes perfect sense. But what is the thinking behind removing this option from those who want to access a text file, add or delete a couple of keystrokes and then save, (WP already has an integrated text editor, right?)

What I'm saying here is that I don't really comprehend (amongst other things) why themes are obligatory. I genuinely struggle to reconcile myself with the idea that I have to have a theme - and jump through all the hoops associated with the whole theme paradigm - when every theme (it strikes me) always seems a lot more convoluted than calling a plaintext CSS file. Can themes be optional? If they can, that's ideal, but it's as hard to find information on the web on running a WP-powered website without a theme as it is on running a WP-powered website without a database.

These are just two examples. Every time I dip into WP, I find I have many more questions which lead me first to head-scratching, then to frustration and, eventually, to paralysis.

I am unused to coming across software which so comprehensively baffles me.

What I find even more perplexing is that there are millions of comments across the web, similar to @TorontoBoy's above:

Wordpress is very easy to use to write content and publish.


where, because WP seems to go out of its way to make many simple, established conventions and processes, vastly more complicated (requiring more steps, more files, more folder locations, occasional inconsistency etc.) than they would be without WP, that I fail to see how Wordpress can be described as very easy.

The reason I am looking for a WP course is because, after years of frustration and paralysis, I want the penny to drop. I want to see WP with the same clarity that I see web development without WP, such that I can switch backwards and forwards with relatively little friction, rather than looking at someone else's WP project and forever being a prisoner of ignorance, doomed to reply: "I'm sorry, I've tried, but I can't begin to get a handle on Wordpress. Nothing about the way it works makes any coherent sense to me at all."

ronin

12:26 pm on Mar 14, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have never yet had call to deploy a database


On reflection, that's not entirely true.

Quite a number of years ago, I once installed and maintained an instance of phpBB and that required a MySQL Database, so I concede I did need a database there. (You can't run phpBB without some sort of Database.)

And about two and half years ago, I wrote a custom Account Login system (full-stack, using JavaScript and PHP) and IndexedDB was (and remains) an active component of that system.

See: [developer.mozilla.org...]

lexipixel

12:47 pm on Mar 14, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I cannot begin to comprehend it, systemically, at even a relatively basic level


I find it much easier to understand any system when I have a well defined task to accomplish.

Much of the time the task that calls for WordPress is "create a website that client (and client's employees) can update and manage". As stated in this thread -- non-technical people find it very easy to add content to an up and running Wordpress installation.

For me, I wanted to build a "static" traditional (5) Page website e.g. -- "Home | About Us | Products / Services | Contact Us" and have the contact form work, and have it all responsive without ever thinking about design or image sizing. (This can be done in 15-20 minutes if you have text and image ready to go).

those who want to access a text file, add or delete a couple of keystrokes and then save,
(WP already has an integrated text editor, right?)


To edit a theme's CSS or other text files from within WordPress go to --

WP Admin / Dashboard > Appearance > Theme File Editor > Style.css

Edit as desired, click [Update File ], refresh page with CSS elements you're working on to see if the update did what you expected.

You may find more than one .CSS file in a WordPress theme, (style.css is mandatory and the default stylesheet file name).

Theme Handbook / Main Stylesheet(style.css)
[developer.wordpress.org ]

... BUT -- in production you should NOT edit the theme's style.css (unless you developed the theme yourself). You should create a Child Theme and do your editing there, (the "cascade" will make sure your child "style.css" file overtakes the default styles -- and if the theme developer releases an update it won't overwrite your edits).

Theme Handbook / Child Themes
[developer.wordpress.org ]

NickMNS

1:30 pm on Mar 14, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



But In 25 years of writing static web pages, static web sites, dynamic web sites, PWA (progressive web apps), single page apps and Electron-based desktop apps, I have never yet had call to deploy a database.

I am astonished by this comment. Not every website/application needs a DB but those that don't are more the exception than the rule.

And about two and half years ago, I wrote a custom Account Login system (full-stack, using JavaScript and PHP) and IndexedDB was (and remains) an active component of that system.

How can you have a secure login system with user authentication without a server side database? I suppose it's possible but it certainly isn't making your life easy, or is it keeping with best practice.

Why have a DB? Because you want to separate your content from your code and a DB is the easiest and most efficient way of managing the content.

I am trying to understand the mentality behind the design decisions in WordPress, so that I might adopt it in a project, if and when I ever might need to / should I ever need to.

Word Press is a CMS, but it is a CMS that is designed to do anything and everything while being easy to use. It certainly does that well, but by fulfilling it's goals it results in, under the hood, a huge bloated code base that, as other have mentioned, is nearly impossible to understand. So it's use case is simple, if the end user of the system needs ease of use (eg: doesn't know how to code or doesn't want to) and is willing to compromise on certain aspects of performance, then WP is good choices. If you have an application that doesn't fit the basic, write content, publish model, then WP is likely not the best solution.

ronin

3:54 pm on Mar 14, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Off-topic aside @NickMNS:

Q:
How can you have a secure login system with user authentication without a server side database?


A: For the project in question, very little per-user authentication data needs to be kept server-side (and the number of users will never go beyond 4 figures). Consequently the very minimal amount of data kept server-side - however it is split up, re-arranged, ordered, obfuscated and / or encrypted - needs to be remote, but does not need to be housed in a formal database - if you like, it already represents the results the database would return when queried.

I will concede, however, that this particular project is the closest I have ever come to appreciating a genuine need-case for a database.

Although I started learning PHP in 2012 and continue to use it extensively today, I make proficient use of front-end storage technologies like sessionStorage, localStorage, queryStrings, JSON, base-64 encoding, Data URLs, ServiceWorkers, steganography etc. A steadily growing number of my projects barely even need a server, never mind a server-side database.

ronin

11:26 am on Mar 15, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thank you, @lexipixel, I very much appreciate your specific - and useful - guidance above.

Though, this confirms a few of my suspicions and suggests to me that my underlying confusion is justified in the first place.

WP Admin / Dashboard > Appearance > Theme File Editor > Style.css


That's helpful to know. But it does immediately indicate that I need to start messing around with the theme.

I don't want to touch the theme.

Ideally, whenever I use WP, I don't want to have a theme at all - I want to skip the theme.

I'm more than happy to set up and run a WP website without a theme. If I can entirely avoid it, it will be one less thing to worry about and - my principal concern - it will keep things simpler.

You may find more than one .CSS file in a WordPress theme


Right. And there may be PHP files. And JS files. And who knows what else? And this is why I don't want a theme. A CSS file is a single dependency. A theme is a whole bundle of inter-related dependencies which collectively comprise a super-dependency. This is not my understanding of KISS.

... BUT -- in production you should NOT edit the theme's style.css (unless you developed the theme yourself)


Yes, I have also gleaned that this is best practice.

So, now it gets worse. Now we associate the whole bundle of inter-related dependencies which collectively comprise a super-dependency with another semi-separate dependency at another level of architecture. Really? What the hell is going on here?

Time after time, non-technical people write blogs and forum posts reassuring me that this is easy.

It doesn't sound that easy.

It's not controversial to point out there are demonstrably easier alternative approaches available.

Even when we take the position that this approach may reasonably be described as "easy"... how is any of this simpler than a single CSS file with a cascade?

I trust that you understand my incomprehension is at a conceptual / architectural level and that, yes, if I absolutely had to make the effort to work with / work around all this junk, then yes I could. But why? Why make things more difficult? Why isn't WP offering themes and child-themes as an option rather than trying to make them obligatory? This is an issue (one of many issues) I can't get my head around.

And why the million voices insisting this is easy? It's like a million people telling you how easy it is to ride a penny-farthing that they rent from the store down the road. Yes, I'm sure you can get used to it. And once you do, you can cycle down the road on your penny farthing without too many hitches. But why is this simpler than riding a standard bicycle? It's weird and more elaborate - and unnecessarily more elaborate - isn't it?

Even if some people prefer penny farthings (and why not?), why isn't the same store renting out standard bicycles as well as penny-farthings? Why is there no choice? Why is the weird, unnecessarily more elaborate form of velociped the only one on offer?

I won't go on. You see my knotted frustration. I find WordPress complexifies and complicates the simplest processes and then yells at me that it has made them simpler - and all I see is greater (entirely unecessary) complexity.

lexipixel

1:15 pm on Mar 15, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You may find more than one .CSS file in a WordPress theme

Right. And there may be PHP files. And JS files. And who knows what else?
How is any of this simpler than a single CSS file with a cascade?


You can run WordPress pretty bare -- a "theme" only requires (2) files: "style.css" and "index.php"

1. create style.css - could be as simple as...

/* - - - - - - - - - - - - - - - - - - - - - - -
Theme Name: ronin
Version: 0.0.1
Description: bare theme
- - - - - - - - - - - - - - - - - - - - - - - */
html, body {
border: none;
margin: 0;
padding: 0;
}


2. create index.php - (this will display any "posts" -- giving you the basic functionality of a blog -- if you are building a "static" site it could be even simpler)...

<!DOCTYPE html>
<html>
<head>
<title>My Blog</title>
<link rel="stylesheet" href="<?php echo esc_url( get_stylesheet_uri() ); ?>" type="text/css" />
<?php wp_head(); ?>
</head>
<body>
<h1><?php bloginfo( 'name' ); ?></h1>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
<?php endwhile; ?>
<?php else: ?>
<p>No posts found.</p>
<?php endif; ?>
<?php wp_footer(); ?>
</body>
</html>


3. FTP into your WordPress installation and navigate to the /wp-content/themes/ folder, within it create a folder "ronin", (e.g. -- /wp-content/themes/ronin/ ) and upload the index.php and style.css files into that folder.

4. go to the Wp-Admin / Dashboard > Appearance > Themes and "Activate" the "ronin" theme.

For more help to create a theme, see:

Theme Handbook / Getting Started / Your First Theme:
[developer.wordpress.org...]

.

NickMNS

1:25 pm on Mar 15, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You don't get it. It is easy.

WP is a black box, you add your content and the webpage comes out the other side. Easy!

But no! you feel the need to open the box and try to see how the sausage is made. Obviously, that part isn't easy, elegant or pretty. And you are absolutely correct, if you know how to make sausage without the black box, you can make it better, faster and easier. WP was created for people that don't code or don't want to code.

Although I started learning PHP in 2012 and continue to use it extensively today, I make proficient use of front-end storage technologies like sessionStorage, localStorage, queryStrings, JSON, base-64 encoding, Data URLs, ServiceWorkers, steganography etc. A steadily growing number of my projects barely even need a server, never mind a server-side database.

This is the problem, you know how to code and are not satisfied not knowing how the things (webpages/apps) that you create work. I'm the same. WP was not invented for us.

Dimitri

1:29 pm on Mar 15, 2022 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



<!DOCTYPE html>
<html>
<head>
<title>My Blog</title>
<link rel="stylesheet" href="<?php echo esc_url( get_stylesheet_uri() ); ?>" type="text/css" />
<?php wp_head(); ?>
</head>
<body>
<h1><?php bloginfo( 'name' ); ?></h1>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
<?php endwhile; ?>
<?php else: ?>
<p>No posts found.</p>
<?php endif; ?>
<?php wp_footer(); ?>
</body>
</html>


Why is all the PHP and HTML all mixed together like a big ball of mud?

On this point, I agree with @ronin :-D ...

Who writes stuff like this?

... unfortunately, lot of people are still doing this. ...

lexipixel

3:25 pm on Mar 15, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Why is all the PHP and HTML all mixed together like a big ball of mud?


Some output from the WP databases get HTML tags / formatting added to it dynamically, (e.g. list items, nesting comment threads, etc), while other content require tags wrapped around the calling function to format the output. It's not pretty.

On this point, I agree with @ronin :-D ...


I agree too -- the coding style is nothing I would ever do on my own.