WordPress is an open-source content management system (CMS) stewarded by the WordPress Foundation, with its dominant commercial contributor being Automattic. It's the #13 most-used web technology overall, reported in roughly 13.6% of developer surveys, and powers a huge share of the entire web. It's used because its massive plugin and theme ecosystem lets non-developers build full sites through a dashboard, while developers extend it with custom PHP themes and plugins.
A WordPress plugin is just a PHP file that hooks into WordPress's action/filter system โ here a plugin adds a custom message to the end of every post.
<?php
/* Plugin Name: Post Footer Note */
function add_post_footer_note($content) {
if ( is_single() ) {
$content .= '<p><em>Thanks for reading!</em></p>';
}
return $content;
}
add_filter( 'the_content', 'add_post_footer_note' );
add_action( 'wp_enqueue_scripts', function() {
wp_enqueue_style( 'footer-note-style', plugin_dir_url( __FILE__ ) . 'style.css' );
});
Download WordPress and run it locally with WP-CLI, or use a one-click host. WP-CLI can scaffold a full local site from the command line.
# download WordPress core with WP-CLI
wp core download
# create wp-config.php and install the site
wp config create --dbname=mysite --dbuser=root --dbpass=secret
wp core install --url=localhost --title="My Site" --admin_user=admin --admin_password=secret [email protected]