Wordpress Bundle
  • What is Wordpress Bundle?
  • Getting started
    • Installation
    • Wordpress
    • Router
    • Cron job
    • Templates
  • Reference
    • Argument resolver
    • Controller
      • AdminAction
      • BlogController
      • FrontAction
      • WordpressAction
    • Entity
      • Block
      • Blog
      • Comment
      • File
      • Image
      • Menu
      • MenuItem
      • Post
      • Term
      • User
    • Repository
      • CommentRepository
      • PostRepository
      • TermRepository
      • UserRepository
    • Service
      • PaginationService
      • BreacrumbService
  • Guides
    • Server requirements
    • Install plugins
    • Use Multisite
    • Gutenberg
    • WP Steroids plugin
      • Image options
      • Maintenance
      • Admin pages removal
      • WYSIWYG Editor
      • Feature Support
      • Multi-site configuration
      • Constants definition
      • ACF configuration
      • Menu
      • Custom Post type
      • Advanced permalink settings
      • Custom Taxonomy
      • Templates
      • Page states
      • External table viewer
      • Roles
      • Optimisations
      • Security
      • Search
    • Twig Cookbook
    • Inject variables in all templates
    • Internationalization
    • Extending Wordpress Bundle
    • Error pages
    • Site health
  • Integrations
    • Advanced Custom Fields
      • Install ACF PRO
  • Extras
    • Migrating from 1.x to 2.0
    • Roadmap
    • Changelog
    • Alternatives
Powered by GitBook
On this page
  • Demo
  • Feature list
  • Getting started
  • Fundamentals: Dive a little deeper

Was this helpful?

What is Wordpress Bundle?

v2.3.0

This package is a Symfony Bundle designed to use WordPress with Symfony.

How does it work ? When the WordPress bundle is loaded, it includes the minimal amount of WordPress Core files to allow usage of WordPress functions and plugins inside Symfony.

Blog Controller example for single page

/**
 * src/Controller/BlogController.php
 *
 * @param Post $post
 * @param PostRepository $postRepository
 * @param BreadcrumbService $breadcrumbService
 * @return Response
 */
public function pageAction(Post $post, PostRepository $postRepository)
{
    $context = [];
    
    // get current post
    $context['post'] = $post;
    
    // find 10 "brands" ordered by title
    $context['brands'] = $postRepository->findBy(['post_type'=>'brand'], ['title'=>'ASC'], 10);

    return $this->render('page.html.twig', $context);
}

Twig template example for single page

{# templates/page.html.twig #}

{% extends 'layout.html.twig' %}

{% block body %}
<article id="post-{{ post.ID }}" class="{{ post.class }}">

    {% if post.thumbnail %}
        <img src="{{ post.thumbnail|resize(800, 600) }}" alt="{{ post.thumbnail.alt }}"/>
    {% endif %}

    <div class="entry-content">
        
        {{ post.content|raw }}
        
        {# or #}
        
        {% for block in post.blocks %}
            {% include 'block/'~block.name~'.html.twig' %}
        {% endfor %}
    </div>
    
    <small>{{ post.metafields.mention }}</small>
    
    {% for brand in brands %}
        {% include 'brand.html.twig' %}
    {% endfor %}

</article>
{% endblock body %}

Demo

Got 2 minutes? Checkout the demo of our bundle

This is an implementation of the Twenty Nineteen WordPress theme for wordpress-bundle.

Feature list

Using Composer
  • Install/update Wordpress via composer

  • Install/update plugins via composer

Using Symfony
  • Template engine

  • Folder structure

  • Http Cache

  • Routing

  • YML configuration

  • DotEnv

  • Enhanced Security ( Wordpress is 'hidden' )

  • Dynamic image resize

  • MVC

Using Wordpress Bundle
  • Post/Term Repository

  • Controller argument resolver for post(s), term and user

  • Symfony Cache invalidation on update ( Varnish compatible )

  • Post/Image/Menu/Term/User/Comment/Site/Block entity

  • Wordpress predefined routes

  • Site health checker url

  • Static site export command

Using WP Steroids Plugin
  • Permalink configuration for custom post type and taxonomy

  • Gutenberg editor resize

  • Maintenance mode

  • Backup download in dev mode

  • Build hook

  • Disabled automatic update

  • Enhanced Security

  • Better guid using RFC 4122 compliant UUID version 5

  • Multisite images sync ( for multisite as multilanguage )

  • SVG Support

  • Better Performance

  • Wordpress Bugfix

  • CSS Fix

  • Relative urls

  • Multisite post deep copy ( with multisite-language-switcher plugin )

  • Custom datatable support with view and delete actions in admin

Getting started

Follow our handy guides to get started on the basics as quickly as possible:

Fundamentals: Dive a little deeper

Learn the fundamentals of Wordpress Bundle to get a deeper understanding of our main features:

NextInstallation

Last updated 12 months ago

Was this helpful?

Wordpress configuration using YML ( )

view sample
Installation
Wordpress
Router
Cron job
Templates
Argument resolver
Controller
Entity
Repository
Service
GitHub - wearemetabolism/wordpress-bundle-demo at 2.0.xGitHub
Logo