Forum Moderators: rogerd & travelin cat
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.
WP is a mouse designed by a committee and looks very much like an elephant in final form.
Wordpress is very easy to use to write content and publish.
I have never yet had call to deploy a database
I cannot begin to comprehend it, systemically, at even a relatively basic level
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?)
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.
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.
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.
How can you have a secure login system with user authentication without a server side database?
WP Admin / Dashboard > Appearance > Theme File Editor > Style.css
You may find more than one .CSS file in a WordPress theme
... BUT -- in production you should NOT edit the theme's style.css (unless you developed the theme yourself)
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?
/* - - - - - - - - - - - - - - - - - - - - - - -
Theme Name: ronin
Version: 0.0.1
Description: bare theme
- - - - - - - - - - - - - - - - - - - - - - - */
html, body {
border: none;
margin: 0;
padding: 0;
}
<!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> 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.
<!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?
Who writes stuff like this?
Why is all the PHP and HTML all mixed together like a big ball of mud?
On this point, I agree with @ronin :-D ...