Convert Figma logo to code with AI

WordPress logoWordPress

WordPress, Git-ified. This repository is just a mirror of the WordPress subversion repository. Please do not send pull requests. Submit pull requests to https://github.com/WordPress/wordpress-develop and patches to https://core.trac.wordpress.org/ instead.

19,447
12,518
19,447
2

Top Related Projects

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.

Home of the Joomla! Content Management System

4,067

Verbatim mirror of the git.drupal.org repository for Drupal core. Please see the https://github.com/drupal/drupal#contributing. PRs are not accepted on GitHub.

11,507

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.

PrestaShop is the universal open-source software platform to build your e-commerce solution.

11,010

Self-hosted CMS platform based on the Laravel PHP Framework.

Quick Overview

WordPress is a popular open-source content management system (CMS) written in PHP and paired with a MySQL or MariaDB database. It powers a significant portion of websites on the internet, offering a flexible platform for creating blogs, e-commerce sites, and various other web applications.

Pros

  • Extensive plugin and theme ecosystem, allowing for easy customization and extension of functionality
  • User-friendly interface, making it accessible for non-technical users to manage content
  • Large and active community, providing support and continuous development
  • Regular updates and security patches to maintain stability and security

Cons

  • Can be resource-intensive, especially for larger sites or with many plugins
  • Potential security vulnerabilities if not properly maintained or using outdated plugins/themes
  • Performance can be affected by poorly optimized themes or excessive use of plugins
  • Learning curve for advanced customization and development

Code Examples

  1. Registering a custom post type:
function create_book_post_type() {
    register_post_type('book',
        array(
            'labels' => array(
                'name' => __('Books'),
                'singular_name' => __('Book')
            ),
            'public' => true,
            'has_archive' => true,
            'supports' => array('title', 'editor', 'thumbnail'),
        )
    );
}
add_action('init', 'create_book_post_type');
  1. Adding a shortcode:
function custom_greeting_shortcode($atts) {
    $atts = shortcode_atts(array(
        'name' => 'Guest'
    ), $atts);
    
    return 'Hello, ' . esc_html($atts['name']) . '!';
}
add_shortcode('greeting', 'custom_greeting_shortcode');
  1. Enqueuing scripts and styles:
function enqueue_custom_scripts_and_styles() {
    wp_enqueue_style('custom-style', get_template_directory_uri() . '/css/custom-style.css');
    wp_enqueue_script('custom-script', get_template_directory_uri() . '/js/custom-script.js', array('jquery'), '1.0', true);
}
add_action('wp_enqueue_scripts', 'enqueue_custom_scripts_and_styles');

Getting Started

To get started with WordPress development:

  1. Set up a local development environment (e.g., XAMPP, MAMP, or Docker).
  2. Download WordPress from wordpress.org and install it in your local environment.
  3. Choose a theme to work with or create a custom theme.
  4. Create a functions.php file in your theme directory to add custom functionality.
  5. Use WordPress hooks and functions to modify or extend core functionality.
  6. Refer to the WordPress Codex and Developer Resources for detailed documentation and best practices.

Competitor Comparisons

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.

Pros of WooCommerce

  • Specialized e-commerce functionality out of the box
  • Extensive ecosystem of e-commerce-specific plugins and themes
  • Streamlined setup process for online stores

Cons of WooCommerce

  • More resource-intensive, potentially impacting site performance
  • Limited flexibility for non-e-commerce websites
  • Steeper learning curve for developers new to e-commerce

Code Comparison

WordPress core (functions.php):

function wp_enqueue_scripts() {
    wp_enqueue_style( 'style-name', get_stylesheet_uri() );
    wp_enqueue_script( 'script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );

WooCommerce (wc-template-functions.php):

function woocommerce_template_loop_product_title() {
    echo '<h2 class="' . esc_attr( apply_filters( 'woocommerce_product_loop_title_classes', 'woocommerce-loop-product__title' ) ) . '">' . get_the_title() . '</h2>';
}

The WordPress code snippet demonstrates basic script and style enqueuing, while the WooCommerce example shows a function specific to e-commerce product loops, highlighting the specialized nature of WooCommerce compared to the more general-purpose WordPress core.

Home of the Joomla! Content Management System

Pros of Joomla

  • More flexible and customizable out-of-the-box
  • Better suited for complex, content-heavy websites
  • Stronger built-in security features

Cons of Joomla

  • Steeper learning curve for beginners
  • Smaller community and fewer third-party extensions
  • Less intuitive admin interface

Code Comparison

WordPress (functions.php):

function enqueue_custom_scripts() {
    wp_enqueue_script('custom-script', get_template_directory_uri() . '/js/custom.js', array('jquery'), '1.0', true);
}
add_action('wp_enqueue_scripts', 'enqueue_custom_scripts');

Joomla (component entry point):

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\BaseController;

$controller = BaseController::getInstance('MyComponent');
$controller->execute(Factory::getApplication()->input->get('task'));
$controller->redirect();

Both WordPress and Joomla are popular content management systems, but they have different strengths and weaknesses. WordPress is generally easier to use and has a larger community, while Joomla offers more flexibility and is better suited for complex websites. The code examples show how each system handles common tasks, with WordPress using a simpler approach and Joomla employing a more structured MVC pattern.

4,067

Verbatim mirror of the git.drupal.org repository for Drupal core. Please see the https://github.com/drupal/drupal#contributing. PRs are not accepted on GitHub.

Pros of Drupal

  • More robust and flexible for complex, enterprise-level websites
  • Better built-in security features and access control
  • Stronger support for multilingual and multisite setups

Cons of Drupal

  • Steeper learning curve for developers and content managers
  • Smaller ecosystem of themes and plugins compared to WordPress
  • Generally requires more server resources and can be slower without optimization

Code Comparison

Drupal (hook implementation):

function mymodule_node_view($node, $view_mode, $langcode) {
  // Custom logic for node viewing
}

WordPress (action hook):

add_action('the_content', 'my_custom_content_filter');
function my_custom_content_filter($content) {
  // Custom logic for content filtering
  return $content;
}

Both platforms use hooks for extending functionality, but Drupal's hook system is more extensive and granular, while WordPress's action/filter system is simpler and more accessible to beginners.

11,507

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.

Pros of Magento 2

  • More robust e-commerce features out-of-the-box
  • Better scalability for large online stores
  • Advanced multi-store and multi-language capabilities

Cons of Magento 2

  • Steeper learning curve and more complex setup
  • Higher hosting requirements and potentially slower performance
  • Smaller community and ecosystem compared to WordPress

Code Comparison

WordPress (PHP):

<?php
function custom_post_type() {
    register_post_type('product',
        array(
            'labels' => array(
                'name' => __('Products'),
                'singular_name' => __('Product')
            ),
            'public' => true,
            'has_archive' => true,
        )
    );
}
add_action('init', 'custom_post_type');

Magento 2 (PHP):

<?php
namespace Vendor\Module\Setup;

use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        // Custom product attribute installation code
    }
}

Both WordPress and Magento 2 are popular open-source platforms, but they serve different purposes. WordPress is a versatile content management system that can be extended for e-commerce, while Magento 2 is specifically designed for online stores. The code examples show the difference in complexity and structure between the two platforms.

PrestaShop is the universal open-source software platform to build your e-commerce solution.

Pros of PrestaShop

  • More specialized for e-commerce with built-in features like product management and order processing
  • Offers a more robust and flexible product catalog system
  • Generally faster performance for online stores due to its focused architecture

Cons of PrestaShop

  • Smaller community and ecosystem compared to WordPress
  • Steeper learning curve for non-technical users
  • Less flexibility for non-e-commerce websites

Code Comparison

PrestaShop (PHP):

class ProductController extends ModuleAdminController
{
    public function __construct()
    {
        $this->bootstrap = true;
        $this->table = 'product';
        $this->className = 'Product';
        parent::__construct();
    }
}

WordPress (PHP):

function custom_post_type() {
    register_post_type('product',
        array(
            'labels' => array(
                'name' => __('Products'),
                'singular_name' => __('Product')
            ),
            'public' => true,
            'has_archive' => true,
        )
    );
}
add_action('init', 'custom_post_type');

The code snippets demonstrate how each platform handles product-related functionality. PrestaShop uses a more object-oriented approach with dedicated controllers, while WordPress relies on its hook system and custom post types for similar functionality.

11,010

Self-hosted CMS platform based on the Laravel PHP Framework.

Pros of October

  • Lightweight and faster performance due to its modern PHP framework (Laravel) base
  • Cleaner, more developer-friendly codebase with better separation of concerns
  • Built-in version control system for content and database

Cons of October

  • Smaller community and ecosystem compared to WordPress
  • Steeper learning curve for non-developers
  • Limited availability of themes and plugins

Code Comparison

WordPress (functions.php):

function enqueue_custom_scripts() {
    wp_enqueue_script('custom-script', get_template_directory_uri() . '/js/custom.js', array('jquery'), '1.0', true);
}
add_action('wp_enqueue_scripts', 'enqueue_custom_scripts');

October (Plugin.php):

public function boot()
{
    $this->addJs('/plugins/myauthor/myplugin/assets/js/custom.js');
}

WordPress uses a hook-based system for adding scripts, while October utilizes a more object-oriented approach within plugin classes. October's method is generally more concise and organized, reflecting its modern framework foundation. However, WordPress's approach is more familiar to many developers due to its widespread use and longer history in the industry.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

WordPress › ReadMe

WordPress

Semantic Personal Publishing Platform

First Things First

Welcome. WordPress is a very special project to me. Every developer and contributor adds something unique to the mix, and together we create something beautiful that I am proud to be a part of. Thousands of hours have gone into WordPress, and we are dedicated to making it better every day. Thank you for making it part of your world.

— Matt Mullenweg

Installation: Famous 5-minute install

  1. Unzip the package in an empty directory and upload everything.
  2. Open wp-admin/install.php in your browser. It will take you through the process to set up a wp-config.php file with your database connection details.
    1. If for some reason this does not work, do not worry. It may not work on all web hosts. Open up wp-config-sample.php with a text editor like WordPad or similar and fill in your database connection details.
    2. Save the file as wp-config.php and upload it.
    3. Open wp-admin/install.php in your browser.
  3. Once the configuration file is set up, the installer will set up the tables needed for your site. If there is an error, double check your wp-config.php file, and try again. If it fails again, please go to the WordPress support forums with as much data as you can gather.
  4. If you did not enter a password, note the password given to you. If you did not provide a username, it will be admin.
  5. The installer should then send you to the login page. Sign in with the username and password you chose during the installation. If a password was generated for you, you can then click on “Profile” to change the password.

Updating

Using the Automatic Updater

  1. Open wp-admin/update-core.php in your browser and follow the instructions.
  2. You wanted more, perhaps? That’s it!

Updating Manually

  1. Before you update anything, make sure you have backup copies of any files you may have modified such as index.php.
  2. Delete your old WordPress files, saving ones you’ve modified.
  3. Upload the new files.
  4. Point your browser to /wp-admin/upgrade.php.

Migrating from other systems

WordPress can import from a number of systems. First you need to get WordPress installed and working as described above, before using our import tools.

System Requirements

  • PHP version 7.2.24 or greater.
  • MySQL version 5.5.5 or greater.

Recommendations

Online Resources

If you have any questions that are not addressed in this document, please take advantage of WordPress’ numerous online resources:

HelpHub
HelpHub is the encyclopedia of all things WordPress. It is the most comprehensive source of information for WordPress available.
The WordPress Blog
This is where you’ll find the latest updates and news related to WordPress. Recent WordPress news appears in your administrative dashboard by default.
WordPress Planet
The WordPress Planet is a news aggregator that brings together posts from WordPress blogs around the web.
WordPress Support Forums
If you’ve looked everywhere and still cannot find an answer, the support forums are very active and have a large community ready to help. To help them help you be sure to use a descriptive thread title and describe your question in as much detail as possible.
WordPress IRC (Internet Relay Chat) Channel
There is an online chat channel that is used for discussion among people who use WordPress and occasionally support topics. The above wiki page should point you in the right direction. (irc.libera.chat #wordpress)

Final Notes

  • If you have any suggestions, ideas, or comments, or if you (gasp!) found a bug, join us in the Support Forums.
  • WordPress has a robust plugin API (Application Programming Interface) that makes extending the code easy. If you are a developer interested in utilizing this, see the Plugin Developer Handbook. You shouldn’t modify any of the core code.

Share the Love

WordPress has no multi-million dollar marketing campaign or celebrity sponsors, but we do have something even better—you. If you enjoy WordPress please consider telling a friend, setting it up for someone less knowledgeable than yourself, or writing the author of a media article that overlooks us.

WordPress is the official continuation of b2/cafélog, which came from Michel V. The work has been continued by the WordPress developers. If you would like to support WordPress, please consider donating.

License

WordPress is free software, and is released under the terms of the GPL (GNU General Public License) version 2 or (at your option) any later version. See license.txt.