What Is theme.json File in WordPress and How to Use It

Are you using a block theme and seeing the theme.json file in WordPress? Maybe you are wondering what the purpose of this file is and whether you should edit it.

The theme.json file is a crucial part of the full site editing experience in WordPress. As block themes become more widespread, it’s important to understand what theme.json does and how to edit it properly.

That’s why we at WPBeginner have put together this comprehensive guide. In this article, we will explain what a theme.json file is and how you can use it to customize your WordPress site.

What is theme.json File in WordPress and How to Use It

What Is the WordPress theme.json File?

The theme.json file is a special theme file introduced in WordPress 5.8. It plays a key role in the full site editing (FSE) experience, which allows you to visually customize every aspect of your WordPress block theme.

Essentially, the theme.json file acts as a blueprint that controls the styling and functionality of your block theme. It contains code that tells WordPress how different elements like colors, typography, layouts, and templates should look and behave.

Why Do WordPress Block Themes Need a theme.json File?

Editing a block theme in WordPress is different from editing a classic theme.

Classic themes use the functions.php file to enable features like custom menus or featured images with the add_theme_support() function. Then, you can style those features with CSS rules in the CSS stylesheet (style.css) file.

The add theme support function in functions.php

In block themes, theme.json acts as a central hub for everything that defines the look and feel of your block theme. It lets you define things like fonts, colors, and layout options in one place, replacing the need for add_theme_support() in functions.php.

That’s why the functions.php file in block themes is often smaller than the equivalent in classic themes.

Having a dedicated theme.json file offers some great benefits over the previous classic theme system.

First, theme.json works hand-in-hand with the WordPress full site editor. This allows you to easily customize your theme’s styles and settings directly within the editor without needing to touch any code.

Choosing a theme style in the Full Site Editor

Furthermore, theme.json aims to create a consistent experience for both developers and users. Some users find it really frustrating when they need to change themes because they have to learn completely new layouts and styling options.

With theme.json, switching themes becomes a smoother process because everything is organized in a similar way.

Finally, by using theme.json, theme developers and users can future-proof their work as WordPress continues to expand its full site editing capabilities.

Now that we’ve covered what a theme.json file is, let’s delve deeper into the topic. You can use the quick links below to navigate through this guide:

Where Do You Find the WordPress theme.json File?

The theme.json file is found inside your theme directory on your web server. The typical file path would be public_html » wp-content » themes » your-theme-name » theme.json.

To access it, you first need to connect to your site via FTP or your hosting account’s file manager.

If you use Bluehost, then you can log in and switch to the ‘Websites’ tab. Then, click on the ‘Settings’ button below your website.

Bluehost site settings

Now, make sure to stay on the ‘Overview’ tab.

Then, scroll down to click on the ‘File Manager’ button.

Bluehost File Manager button

When you open the file manager this way, you will automatically be inside your website’s root folder.

Here, look for the ‘wp-content’ directory and open it. There, you’ll find the ‘themes’ folder which contains all your installed WordPress themes.

Open the folder for the specific block theme you’re using. The theme.json file will be located directly inside this theme directory alongside other theme files.

theme.json location as seen in Bluehost file manager

Once you have found it, you can view the theme.json file using a code editor.

What Does the theme.json File Look Like?

The theme.json file has a specific structure that organizes all the global settings for your WordPress block theme.

Depending on how complex or simple your theme looks, the file can be very short or long. However, you can easily break this file down into 7 top-level sections:

{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {},
"styles": {},
"customTemplates": {},
"templateParts": {},
"patterns": []
}

Here’s a simplified breakdown:

Schema

This part is actually optional to have in block themes, so you may or may not see it in yours.

The schema property links the URL to the WordPress JSON schema, which defines the global settings, styles, and other configurations for your theme.

Version

This section specifies which API version of the theme.json format is being used by the file and ensures it follows the correct structure.

As of the writing of this article, the API is at version 2.

Settings

This property defines the options and controls available for users to customize their theme. These include presets for the theme’s color palette, typography, spacing, gradients, shadows, borders, and so on.

Here’s a very simple example of what the settings property looks like:

{
  "settings": {
    "color": {
      "palette": [
        {
          "slug": "base",
          "color": "#ffffff",
          "name": "White"
        },
        {
          "slug": "contrast",
          "color": "#222222",
          "name": "Dark"
        },
        {
          "slug": "accent",
          "color": "#f08080",
          "name": "Pink"
        },
        {
          "slug": "accent-2",
          "color": "#90ee90",
          "name": "Light Green"
        },
        {
          "slug": "accent-3",
          "color": "#e0ffff",
          "name": "Light Blue"
        }
      ]
    },
    "typography": {
      "fontFamilies": [
        {
          "fontFamily": "Open Sans, sans-serif",
          "slug": "open-sans",
          "name": "Open Sans"
        },
        {
          "fontFamily": "Arial, sans-serif",
          "slug": "arial",
          "name": "Arial"
        },
        {
          "fontFamily": "Times New Roman, serif",
          "slug": "times-new-roman",
          "name": "Times New Roman"
        }
      ],
      "fontSizes": [
        {
          "name": "Extra Small",
          "slug": "xx-small",
          "size": "0.75rem"
        },
        {
          "name": "Small",
          "slug": "small",
          "size": "0.875rem"
        },
        {
          "name": "Medium",
          "slug": "medium",
          "size": "1rem"
        },
        {
          "name": "Large",
          "slug": "large",
          "size": "1.125rem"
        },
        {
          "name": "Extra Large",
          "slug": "x-large",
          "size": "1.25rem"
        },
        {
          "name": "XX-Large",
          "slug": "xx-large",
          "size": "1.5rem"
        }
      ],
      "spacing": {
        "units": ["rem"],
        "values": {
          "small": "1rem",
          "medium": "1.5rem",
          "large": "2rem"
        }
      }
    }
  }
}

If you look at the code, the language used is pretty easy to understand. You can tell that the settings are defining the colors, font families, font sizes, and spacing used in the theme.

If there are any references here or in your theme that you don’t understand, you can check out the official WordPress Settings Reference.

Some elements, like colors and font families, have slugs, like this:

{
  "settings": {
    "color": {
      "palette": [
        {
          "slug": "base",
          "color": "#ffffff",
          "name": "White"
        },

These will come in handy for the styles section later on to make presets, which we will explain in the next part.

Styles

While the settings section defines the theme’s default customization options, the styles section applies them to the theme.

Here, you can apply the customization settings to the entire website or at a block level using presets.

Let’s check out the example below:

{
  "settings": {
    // Existing settings from the previous example
  },
  "styles": {
    "color": {
      "background": "var(--wp--preset--color--base)",
      "text": "var(--wp--preset--color--contrast)"
    },
    "elements": {
      "link": {
        "color": {
          "text": "var(--wp--preset--color--accent-2)"
        }
      },
      "h1": {
        "fontSize": "var(--wp--preset--font-size--xx-large)",
        "lineHeight": "1.2",
        "marginBottom": "1rem"
      },
      "h2": {
        "fontSize": "var(--wp--preset--font-size--x-large)",
        "lineHeight": "1.2",
        "marginBottom": "1rem"
      },
      "h3": {
        "fontSize": "var(--wp--preset--font-size--large)",
        "lineHeight": "1.2",
        "marginBottom": "1rem"
      }
    }
  }
}

As you can tell, there is this line of code appearing throughout this snippet: var(--wp--preset--xxx) . These are presets, which are shortcuts in the styles section that refer back to the values defined in the settings section.

For example, consider {"slug": "base", "color": "#ffffff", "name": "White"} in the settings section. Here, "base" is the slug, and the corresponding preset for this color is var(--wp--preset--color--base) .

Therefore, the code "color": {"background": "var(--wp--preset--color--base)" in styles says that the background color of this theme is white.

Custom Templates

Block theme developers can create predefined layouts for custom pages, posts, or post types for users to use.

For example, the Twenty Twenty-Four theme has several custom templates defined in the theme.json file: Page No Title, Page With Sidebar, Page with wide Image, and Single with Sidebar.

You can use any of these to create your content.

],
"customTemplates": [
  {
    "name": "page-no-title",
    "postTypes": ["page"],
    "title": "Page No Title"
  },
  {
    "name": "page-with-sidebar",
    "postTypes": ["page"],
    "title": "Page With Sidebar"
  },
  {
    "name": "page-wide",
    "postTypes": ["page"],
    "title": "Page with wide Image"
  },
  {
    "name": "single-with-sidebar",
    "postTypes": ["post"],
    "title": "Single with Sidebar"
  }
]

One thing to note is that the theme.json file only references the templates by name and provides metadata about them, such as their title and the post types they are intended for.

However, the actual appearance and functionality of the custom templates are defined in separate template files inside the theme folder.

To see them, you can go to public_html » wp-content » themes » your-theme-name » templates.

The block theme's templates folder seen in Bluehost file manager

Template Parts

Template parts are reusable areas you can apply across your custom templates. These are elements like headers, footers, sidebars, and so on.

Here’s what those template parts look like registered in theme.json:

"templateParts": [
  {
    "area": "header",
    "name": "header",
    "title": "Header"
  },
  {
    "area": "footer",
    "name": "footer",
    "title": "Footer"
  },
  {
    "area": "sidebar",  // Removed "uncategorized"
    "name": "sidebar",
    "title": "Sidebar"
  },
  {
    "area": "post-meta",  // Removed "uncategorized"
    "name": "post-meta",
    "title": "Post Meta"
  }
]

Like custom templates, the theme.json file only references the templates.

Their actual appearance is defined in their own template part files in the parts folder.

The block theme's parts folder seen in Bluehost file manager

Patterns

Patterns are pre-made collections of blocks that let you create custom content layouts on your pages, posts, or anywhere else in your theme.

When you open the full site editor, you may notice the Patterns menu. This is where you can find all the available patterns for your Gutenberg block theme.

The Patterns page in WordPress Full Site Editor

With theme.json, theme developers can reference patterns from the public Pattern directory. It’s a great way to offer more customization options without designing these reusable blocks yourself.

For example, the Twenty Twenty-Four theme references two patterns from the official directory: three columns of services and clients section:

"patterns": [
  "three-columns-of-services",
  "clients-section"
]

We know this because these patterns are in the Patterns menu in the full site editor.

However, they’re not in the patterns folder inside the theme directory.

The block theme's patterns folder as seen in Bluehost file manager

Note: You may notice that the templates, parts, and patterns folders in your theme directory contain files not specified in theme.json, but they’re still visible in the full site editor.

If you’re curious, this is because WordPress is designed to automatically recognize and use these folders based on their naming conventions and location within the theme’s directory.

What You Should Do Before Editing the theme.json File

Since theme.json is a core theme file, editing it directly on your live WordPress website comes with some risk. Accidental mistakes could potentially break your theme or website.

A safer approach is to use a child theme.

A child theme inherits all the styles and functionalities of your parent theme (the block theme you are using) but allows you to customize things without modifying the parent theme itself. This way, if the parent theme receives updates, your customizations won’t be overwritten.

You can read our guide on how to create a child theme in WordPress for more information. This article shows an easy method with the Create Block Theme plugin, which will automatically generate a new theme.json file for your child theme only.

Creating a child theme with Create Block Theme

To ensure a smooth editing experience and avoid any website downtime, we also recommend creating a new backup of your WordPress website. This way, if something goes wrong, you can easily restore your site to its previous state.

We recommend using a plugin like Duplicator for a quick and reliable backup solution.

It’s also recommended to work in a local WordPress development environment or a staging site. This creates a replica of your live website where you can test changes safely without affecting your visitors.

Here are some more tips to keep in mind:

  • Begin with minor edits in your theme.json file and test them thoroughly before making more complex changes.
  • If you’re unsure about any specific property or setting within the theme.json file, consult the official WordPress documentation.
  • Don’t hesitate to seek help from the theme developer’s support team or the WordPress.org support forums if you run into any issues. Check out our guide on how to ask for WordPress support for more information.

How to Edit WordPress theme.json File

Based on our research and testing, we’ve discovered two ways to edit a WordPress theme.json file: using the full-site editor or using code. The first option is much easier and safer and lets you see your modifications from the front end of your website.

Meanwhile, the second choice is recommended if you are comfortable with advanced WordPress development.

Edit theme.json Without Code (Beginners)

To edit your theme.json file without touching the code directly, you can use the Create Block Theme plugin. This plugin was published by the official WordPress.org team to let users create, edit, and save the style variations of their block theme.

First, go ahead and install the WordPress plugin in your admin area. Then, open the full-site editor by going to Appearance » Editor.

Selecting the Full-Site Editor from the WordPress admin panel

You will now see several menus to edit your theme.

Here, select ‘Styles.’

Choosing Styles in the Full Site Editor

Next, click the pencil ‘Edit styles’ icon.

This will take you to the block editor to edit your website’s global styles.

Clicking Edit Styles in Full Site Editor

Now, you can change the style of your theme like normal. You can read the section on how to edit your theme’s global styles in our WordPress full-site editing guide for more information.

Let’s try creating a custom color palette as an example.

The color scheme or palette is a set of default colors for elements like text, backgrounds, and buttons. It ensures a cohesive look throughout your website.

Elements using the same color preset will always match so that your website design looks polished and professional.

To edit the palette, select ‘Colors’ on the Styles settings sidebar.

Editing a block theme's global colors in FSE

On the next screen, you will see some settings to customize your theme’s colors.

Here, click the colors in the ‘Palette’ section.

Opening a block theme's color palette in FSE

In this example, the Twenty Twenty-Four theme has already defined 5 colors in the palette, but you can change any of them to create a custom one from scratch.

To do so, click one of the colors under ‘Theme.’ Then, select any color in the color picker tool.

Changing a block theme's global color in FSE

Now, if you preview your website, you will see that the specific blocks or elements that used the previous color have been replaced with the color you just selected in your palette.

You can repeat the same steps for each color. Then, click ‘Save.’

Saving changes in a block theme in FSE

After saving your changes, click the Create Block Theme button (the wrench icon).

Then, select ‘Save Changes to Theme.’

Saving theme changes to the theme.json file with Create Block Theme

On the next screen, you need to scroll down.

After that, click ‘Save Changes.’ This will prompt WordPress to store all the changes you’ve made to your theme in the theme.json file.

Confirming to save theme changes in Create Block Theme

Once you do that, the block editor will then refresh itself.

Now, click the Create Block Theme button again and select ‘View theme.json.’

Viewing theme.json with Create Block Theme

To see the code for your custom color palette, look for palette that is nested inside color and settings, like so:

"settings": {
  // Some code...
  "color": {
    // Some code...
    "palette":  
  }
}

Under it, you should see the new hex codes of your custom color palette.

Viewing the newly edited theme.json in Create Block Theme

Edit theme.json With Code (Advanced Users)

This method is recommended if you are an aspiring WordPress theme developer or have some experience with code.

First, open your block theme’s theme.json file in your WordPress directory. You can either use the code editor in your web host’s file manager or download the file, edit it on your computer, and upload it back to your server.

We will use the Twenty Twenty-Four theme and Bluehost’s file manager for demonstration purposes. If you are a Bluehost user and are using the file manager, then you can just simply right-click on your theme.json file and click ‘Edit.’

Editing a theme.json file manually with Bluehost file manager

If you use FTP, then you can read our guide on how to use FTP to upload files to WordPress.

Let’s try a simple example of editing your theme.json file: creating custom font sizes.

Again, remember that the settings property specifies your theme’s default styles, whereas the styles property implements them. For this reason, we will edit the settings property in the theme.json file.

If you use a child theme, then you can simply copy and paste the following code into your theme.json file and change the font sizes in pixels as you see fit:

{
  "settings": {
    "typography": {
      "fluid": false,
      "fontSizes": [
        {
          "name": "Small",
          "slug": "small",
          "size": "16px"
        },
        {
          "name": "Medium",
          "slug": "medium",
          "size": "24px"
        },
        {
          "name": "Large",
          "slug": "large",
          "size": "40px"
        },
        {
          "name": "Extra Large",
          "slug": "x-lagrge",  // Typo fixed (large -> large)
          "size": "48px"
        }
      ]
    }
  }
}

Note: If you are editing your parent theme’s file directly, then you need to find the code that says fontSizes .

It should be nested inside typography and settings , like so:

{
  "settings": {
    // Some code...
    "typography": {
      // Some code...
      "fontSizes": [
        // Font size definitions here
      ]
    }
  }
}

After that, replace those lines of code with the code snippet from above. Just make sure that there are no syntax errors in it.

Once done, save the file and preview your website to see your changes. For Bluehost users, you can simply click ‘Save Changes’ in the file manager’s code editor.

Saving changes in the theme.json file in the Bluehost file manager

If you want to edit your theme.json further, we highly encourage getting more familiar with the file’s structure as explained in the previous section.

We also suggest reading the official WordPress Settings Reference, which includes a full list of the available settings properties and instructions for using them.

Bonus Tip: Use WPCode to Add Custom Code to Your Theme

In this guide, you have learned about theme.json and its potential for theme customization. But maybe it still feels a bit overwhelming to edit directly.

Luckily, there’s another user-friendly option for adding custom code and making advanced customizations: WPCode.

With WPCode, you can insert custom code snippets without ever needing to touch your theme files themselves. This significantly reduces the risk of breaking your website during customization.

If you want to learn more about this code snippet plugin, check out our full WPCode review.

Also, here are some helpful tutorials to get you started with using WPCode:

We hope this article helped you learn about the theme.json file in WordPress. You may also want to check out our beginner’s guide on how to edit a WordPress website and our expert pick of the best drag-and-drop page builders for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post What Is theme.json File in WordPress and How to Use It first appeared on WPBeginner.

Best 10+ WordPress Themes to Consider in 2023

It doesn’t matter how complete your business plan is or how good your product or service may be. The success of your business may eventually depend on the look and feel of your online store. Or, maybe, online presence, and how well it represents your brand.

The great thing about the WordPress platform is that it has everything you need. We mean in the way of tools and themes to create a pixel-perfect digital storefront that will engage and captivate your visitors.

Finding just the best WordPress theme should not be difficult. Except there are thousands to choose from.  Not all of them can give you a website that can adequately capture the look and feel of your brand. While giving its visitors a seamless user experience.

The challenge is to choose a theme that enables you to beautifully present your content, engage your visitors, and boost your brand.

This post features 12 best WordPress themes for 2023 that can and will do exactly that.

1. Be – Multipurpose WordPress Theme

This ultra-popular multipurpose WordPress theme is the grandaddy of them all in terms of sheer size with its 250,000+ users and its 40+ core features that includes a 650+ pre-built website library, a huge array of design elements and options, and several of the most advanced page and website building tools on the market.

Among the key features this multipurpose WordPress theme places at your fingertips you’ll find –

  • Be Builder, the fastest, lightest, and most intuitive website builder for WordPress with its impressive page-building capabilities that include the ability to view each element while customizing it.
  • Be Builder Blocks with its constantly growing library of pre-built sections.
  • Be Builder Woo, that offers a simple way to design an online store complete with customer-friendly shopping features, product previews, a sticky menu, and more.
  • Be Theme’s Header Builder 2.0 with 14 pre-build headers (or create your own) including mobile-ready headers and interactive headers.

There’s much, much more. Click on the banner to find out for yourself.

2. Total WordPress Theme

A seemingly endless number of design options, customizer settings, layout choices, and navigation options, coupled with dynamic template functionality, and the popular WPBakery frontend drag and drop page builder enables Total’s users to create attractive, responsive, and engaging websites with ease.

  • Total’s Design elements include Customizer Theme settings, Unlimited Styling, page builder blocks and extra modules, Post entry cards, animations, layout options, and custom backgrounds.
  • Total is translation and RTL ready, is fully integrated with WooCommerce, and features developer-friendly code.
  • Slider Revolution is included together with a custom font manager
  • Total is compatible with most of the popular plugins including bbPress, Uber Menu, Easy Digital Downloads, WPML, Yoast, Ultimate Addons. and more.

“Build it your way.” could easily be this aptly named theme’s slogan. Click on the banner to find out more about what has made Total’s 48,000 customers happy. 

3. Electro – WooCommerce Theme for Affiliates, Dropship and Marketplace Websites

Join 21.2K+ happy customers as you take your design to the next level when you create your store with Electro, the complete platform that creates pixel-perfect designs while producing 100% clean code.

  • Electro is fast. A typical page load time is 1.25 seconds.
  • This WordPress eCommerce theme is an ideal choice for building affiliate, dropship, and marketplace websites and WooCommerce electronic stores. It is extremely user friendly, highly customizable, and responsive.
  • Electro is page-builder independent. It is also fully compatible with WPBakery and Elementor page builders.
  • Electro provides a choice of innovative WooCommerce layouts you can customize to showcase your products, show reviews, and create customer-centric checkout features.

Click on the banner to learn more about what Electro has to offer and be prepared to be impressed.

4. Uncode – Creative & WooCommerce WordPress Theme

This easy to work with creative WordPress theme places the tools you need at your fingertips for building a stunning website and WooCommerce online store you want to be attractive, engaging, and a step ahead of the competition.

  • Uncode’s Advanced Drag & Drop Product Builder is supplemented with 70+ professionally designed mix and match pre-made designs, 500+ wireframes sections, and more.

Uncode’s 100,000+ sales have made it one of the top selling Envato themes of all time.

5. TheGem – Creative and WooCommerce WordPress Theme

TheGem, the best-selling creative WordPress theme and website builder, was designed with versatility in mind and unique features:

  • 400+ pre-built websites in outstanding design
  • Theme Builder for building headers, footers, mega menus, popups etc. right away in Elementor or WPBakery 
  • TheGem Blocks: a collection of 600+ pre-built page sections to accelerate your work   
  • WooCommerce Builder for custom tailored products, shop pages & optimized checkouts. With AJAX filters, variation swatches and more premium WooCommerce features  

You’ll love the 5-star customer support, as have 60,000 others.

6. Vault – Multi-Purpose Elementor WordPress Theme

Vault, with its interactive design tools and many customization options, enables you to build a clean website that features an online presence with landing pages designed to attract and engage customers.

  • Start with Vault’s 50+ full websites and 1,200+ templates
  • Vault’s 230+ expertly coded widgets help generate more traffic, leads, and conversions.
  • Vault’s global design system maintains consistency throughout your site.
  • And the Theme Builder gives you complete control over your website’s static elements.

7. Rey WordPress WooCommerce Theme

The Rey WooCommerce theme takes building a WooCommerce site to the next level with its powerful Elementor and WooCommerce integrations coupled with WordPress’s sophisticated engine.

  • Rey features an outstanding selection of pre-made designs with lifetime updates
  • Rey provides a selection of Elementor widgets that will cover almost any situation
  • Ajax Navigation and Filters streamline your website’s page browsing and navigation functionality

Rey is performance oriented, SEO and developer friendly, and responsive. 

8. Blocksy Free Ecommerce WordPress Theme

Blocksy is a free eCommerce WordPress theme that is lightning fast and loaded with intuitive website-building features that include –

  • a header builder, a footer builder, custom post types, and dynamic data support.
  • a content blocks feature that allows insertion of any piece of content anywhere throughout your website
  • a local Google fonts feature that provides time-saving local caching on your own web server, a White Label feature, and a Mega Menu.

9. Avada WordPress Theme

Avada is the ultimate WordPress theme and website builder. Avada is also the #1 best selling WordPress theme of all time with more than 750,000 users.

  • Avada is built for speed and its impeccable code quality leads to high performance results
  • Avada’s WooCommerce builder is just right for creating custom shop, cart, checkout, and product layouts.
  • Avada features 400+ pre-built web pages, 120+ design and layout elements in a 100% responsive framework.

10. KnowAll – WordPress Knowledge Base Theme

KnowAll is the most powerful WordPress theme on the market for building a performant and easy to use knowledge base.

  • KnowAll’s advanced analytics help you gain valuable insights into how visitors are using your knowledge base.

KnowAll provides feedback from your knowledge base visitors so you can better understand what content visitors find to be useful and engaging and identify and refine unhelpful articles.

11. Impeka – Creative WordPress theme

Intuitive for beginners and full of pleasant surprises for more advanced users, the Impeka WordPress theme provides complete freedom to realize your vision of an ideal website and make it happen fast. Here’s why:

  • Impeka is the overall best rated WordPress theme on ThemeForest.
  • Features include the Enhanced WPBakery page builder, Elementor and Gutenberg editors, and WooCommerce integration.
  • There are plenty of detailed demos, plus mega menu, footer, and popup builders.

Impeka is fast and SEO optimized.

12. XStore – WooCommerce WordPress Theme

The first thing you’ll notice about XStore is the incredible value you get for a small investment. The second is probably its most popular feature, its 120 awesome pre-built shops.

There’s more of course –

  • Like XStore’s full support for Elementor, the 60+ Elementor widgets, and its header and single product page builders.
  • Or the eCommerce features and tools to create a multi-vendor marketplace. 

XStore is a great choice for building high converting stores.

Finding the right WordPress theme should be easy. Except there are thousands to choose from and not all of them are capable of giving you the results you need. You want to adequately capture the look and feel of your brand and, at the same time, providing your visitors with a seamless user experience.

The 12 best WordPress themes featured in this post can do precisely that.

Blocksy Review – An Innovative, Gutenberg Ready and 100% Free WordPress Theme

This post is originally published on Designmodo: Blocksy Review – An Innovative, Gutenberg Ready and 100% Free WordPress Theme

Blocksy Review - An Innovative, Free WordPress Theme

If you’re on the lookout for a fresh Gutenberg WordPress theme that will make your website look great but also give you rich customization options, then perhaps you should give Blocksy a look. In this Blocksy review, we take a …

For more information please contact Designmodo

HTML to WordPress Theme Tutorial: Step 1 – Converting Your HTML to PHP

For many of us, our first experience of coding for WordPress is when we write our first theme.

After all, every WordPress site needs a theme, and if you want something bespoke then it makes sense to code it yourself.

When I started out with WordPress in 2010, I’d never worked with a content management system (CMS) before. But I’d coded plenty of HTML and CSS, either within large sites that used HTML for content as part of a CMS, or for small client sites I built from scratch.

I spent weeks weighing up the pros and cons of different CMSes I could use for client sites (remember, this was before WordPress became the dominant force it is today) and decided on WordPress for two reasons. The first was the awesome community of users and developers that we’re all a part of. And the second was the fact that with some HTML experience, it’s not that hard to create a WordPress theme.

Continue reading, or jump ahead using these links:

In this series of three posts, I’m going to walk you through the process of creating your own WordPress theme from static HTML. We’ll start with a single HTML file and a CSS stylesheet, and convert those into a WordPress theme with all the bells and whistles that entails.

The posts will work through the process in order:

  1. Creating your index.php file, adding in template tags and a loop.
  2. Creating additional template files and template parts such as the header, sidebar and footer files.
  3. Adding functionality, including widgets and a navigation menu, and getting your functions file set up.

In this post I’ll create a single file – index.php. That will be based on the index.html file from my static site, but I’ll remove the content and replace it with template tags and a loop.

So let’s get started!

What You’ll Need

To follow along with this series, you’ll need a few tools:

  • A development installation of WordPress, preferably on your local machine.
  • A code editor.
  • A static site – if you don’t have one you’re working from, you can download the files I’m using.

Make sure you do this work on a development site, not a live site – you don’t want the world to see your theme until it’s ready.

The Starting Code

The starting site has just two files – our index.html and style.css. I’ve deliberately kept things simple, and used a pared down version of my site. Here’s how it looks:

Our starting home page

You can find the contents of the index.html and style.css files on Github – I’m not going to show the code here as there’s a lot!

Note: This is a basic set of code designed to help you create your own theme. If you want to use it for live sites, you’ll probably have to add extra styling etc. to it. It wouldn’t pass the theme directory requirements. Please just use it for learning, not to power a live site.

Setting Up Your Theme

To create your theme, you’ll need a folder for it in your WordPress installation. Using your code editor or file manager, go to wp-content/themes and create a new folder. Give it whatever name you want. I’m going to call mine wpmudev-theme-part1.

Copy your index.html and style.css files to that folder. They won’t do anything yet, but they will soon.

Now you have a folder with two files in it. You’re getting started!

Right now, WordPress doesn’t know that you have a theme. Any theme needs just two files: index.php and style.css. As you’ll see while following along with this series, you normally need more than that, but the theme will function with just two.

Let’s start by adding commented out text to your stylesheet. Open your style.css file and add the following:

This gives WordPress the information it needs to recognise that this is the theme stylesheet. Feel free to edit the details, adding your own name and URL and changing the name of the theme if you like.

The next thing to do is change the filename of your index.html file to index.php. You now have the two files that will get your theme working.

However you haven’t added any PHP yet. To do that we’ll need to add some template tags and a loop. Let’s do that.

Adding Template Tags

A template tag is a special WordPress function that you use in a theme template file. It can do any one of a wide variety of things – to see the range of template tags on offer, check out the codex.

Here we’re going to add template tags for two things:

  • Calling the stylesheet
  • Automatically generated classes and IDs for CSS

Calling the Stylesheet

Right now if you open up your site with your new theme activated, you’ll notice that none of your styling is loading. Here’s how mine looks:

My site with no CSS

Don’t panic! You just need to add a stylesheet call to the head section of your index file.

Note: In part three of this series, I’ll show you how to move this to the theme functions file, which is best practice. For now we’re just working with two files: the stylesheet and index.php files, so we’ll stick with those.)

Open up your index.php file. Find this line:

Edit it so instead of calling a static file, it uses PHP to load the theme stylesheet:

This uses the bloginfo() template tag, a useful tag that fetches all kinds of information about your website from the database. In this case it’s fetching the url of the theme and then accessing the file in that folder called style.css.

Now refresh your home page. You’ll find that the styles load. Here’s my page now:

My site with styles working

You’ll notice that it looks exactly like your old static site. That doesn’t mean we’re done though – nowhere near! The content is pulling through from static content in that index.php file, which we’ll correct by adding a loop. But first let’s add some more template tags.

Creating Automatically Generated Classes and IDs

It’s really useful to be able to get WordPress to automatically generate CSS classes and IDs for your posts and your <body> element. This means you can later use those classes for styling, targeting specific post types, categories and more.

Open your index.php file. Find the opening <body> tag. It’ll be sitting on its own line, after the closing </head> tag.

Edit it so it reads like this:

This uses the body_class() template tag, which will detect what kind of page your website visitors are on at any given time and generate CSS classes based on that.

If you refresh your page and inspect the code you’ll find that WordPress automatically adds some CSS classes for you:

These will vary according to the page you’re on in your site and which type of content it’s displaying. You can use this to target your CSS at certain content types such as single posts, certain categories or anything you want.

Now let’s do this for your individual post. Find this line in your index.php file:

Edit that line so it reads like this:

This uses two template tags:

  • The the_ID() tag fetches the post ID and uses that to give the post a unique ID.
  • The post_class() tag works in a similar way to the body_class() tag, adding a list of classes to the article element that correspond to the type of post this is. Note that right now this won’t work properly as you’re not fetching a post from the database – but when we add the loop next, it will.

Adding a Loop

Now for the fun bit. Right now, the content of your page is hard-coded in. You want it to be populated from a call to the database, so that the correct content will be displayed whatever page you’re on.

In your index.php file, find the code inside the <article> tag (the one you already added the ID and closes to with template tags).

Edit that code so it reads like this:

There’s a lot of code there – if you want to understand what’s going on, check out our post explaining the loop.

Now if you refresh your home page you’ll see some very different content – your posts. If this is a brand new WordPress install you’ll see the default post that’s added when you install WordPress:

My site now has a loop

Adding Hooks

The final step in this first part of our series is to add a couple of important hooks to our code. These are placed in the head section and the footer, and they’re essential for many plugins to work.

In your head section, add this before the closing </head> tag:

Now move down to the end of your index.php file. Before the closing </body> tag, add the wp_footer() hook:

That adds a special hook to the top and bottom of every page in your site – these are essential for your themes and your site to work properly, so don’t skip them.

Now save your file.

What Comes Next

You now have the beginnings of a WordPress theme. However there’s still work to do. In the next part of this series I’ll walk you through the process of splitting your theme up into multiple template files. You’ll create separate files for the header, sidebar and footer, an include file of the loop, and a separate file for each of pages and archives.

7 Reasons Why Your WordPress Plugins or Themes Won’t Install

For the most part, I think WordPress is a pretty solid platform. Of course, we complicate things when we drag third-party elements into it for the sake of improving performance or security, adding new design features, or opening up greater functionality. But the payoff is generally worth it. Without those integrations, you’d have to do much more manual coding and that just doesn’t isn’t the most effective way to build a website these days.

That said, there are times when issues arise when you try using WordPress plugins and themes on your website. As I’ve talked about before, there are WordPress plugin conflicts that occur upon initial installation or during updates. But there are other ways in which they can cause issues for you before you even get them on the site.

Below, I’m going to break down the 7 reasons why a WordPress plugin or theme won’t install on a website and some ways to get around these errors.

7 Reasons Why Your WordPress Plugin or Theme Won’t Install

The nice thing about these kinds of WordPress errors is that they’re easy to identify. Usually, there’s an error message that accompanies each failure to load, so there isn’t as much troubleshooting with something like this as there are with other WordPress errors. It’s just more annoying than anything else.

So, here are the most common reasons why your WordPress plugin or theme won’t install and what to do about them:

1. Uploading the Wrong File Format

Typically, you’ll encounter an installation error during the manual upload of a theme or plugin through the Add New / Upload option in WordPress (as opposed to directly installing from the WordPress repository):

Plugin or Theme Won't Install - Upload New Plugin
Install your new WordPress plugins here.

When you see the following “bad format” message, it means that you have not uploaded the native files provided to you by the theme or plugin developer.

Plugin or Theme Won't Install - Bad Format Error
This is what the “bad format” error looks like.

The only plugin or theme files that should ever be uploaded to WordPress are zip files.

Before you get in touch with the plugin or theme developer, verify that you didn’t receive the correct file from them. If this came from your client, they may have unzipped the folder and given you what they thought was the correct file from within. If it didn’t come from the client and you really don’t have the right folders, get in touch with the developer.

2. Missing Files

Now, let’s say you did try and upload a zip file into WordPress, but you saw this error message instead:

Plugin or Theme Won't Install - Zip Missing Files
This is what the “missing files” error looks like.

This means that the files contained within the folder are not what WordPress was expecting.

Unzip the folder and review the contents. Is this even the correct zip? Does it contain all the files you would expect a plugin or theme to have? You can cross-check the contents of the folder against WordPress’s recommendations for files that should be included in the package:

If you’ve detected any missing files, reach out to the developer for assistance.

3. Syntax Error

When you purchase a WordPress plugin or theme from a reputable developer, you shouldn’t have to worry about this kind of error occurring.

However, let’s say your client was trying to cut corners and save money, and so they found some plugin or theme online that looked promising. You try to install it in WordPress and you receive a syntax error. It’ll usually say something about “parse error” and “syntax error”.

All this means is that there’s something wrong in the code. This error can actually come up if you erroneously try to edit a theme or plugin once it’s installed on your website. However, if you’re seeing it during installation, then the error lies with the developer.

If you want to review the code of the plugin or theme on your own, you might be able to detect and repair the error yourself. Before you dig in, check into any other reported issues with the plugin or theme if there’s a support system attached to it (through WordPress or a marketplace).

If there aren’t any, your safest bet might be to have your client get a new plugin or theme. If you don’t trust the developer to code the backend well, this issue could keep coming up with each new update (and you don’t want to deal with that).

4. Uploading the Wrong Zip File

This error is one you’re probably going to encounter with larger, multipurpose themes. You received a zip file from your client and, by all intents and purposes, it looks to be in good shape. However, let’s say you go to add the new theme:

Plugin or Theme Won't Install - Add New Theme
Install your new WordPress theme here.

Then you see this error:

Plugin or Theme Won't Install - Stylesheet Error
This is what the stylesheet error looks like.

In actuality, the stylesheet is not missing. You probably just downloaded the wrong version of the theme file.

Some developers offer up different zip packages for their themes, especially if they’re including plugins and child themes within them. Here’s an example of how Uncode includes various download options on Themeforest:

Plugin or Theme Won't Install - Theme Download Options
Various file downloads are available when you purchase a premium theme.

While it’s essential to have that full file with all the documentation, licenses, plugins, and alternate themes, that file cannot be uploaded into WordPress because it looks like this:

Plugin or Theme Won't Install - Theme Unzipped
As you can see, the contents of this zip file wasn’t going to get me very far in WordPress.

WordPress can unzip the top-level zip file, but it won’t be able to go through and unzip everything else contained within the folder. If you want to get your theme in there, then you need to upload the proper zip file.

5. Exceeding the Memory Limit

I touched on this error recently when I talked about the server issues that affect WordPress. Basically, this happens when your web hosting PHP memory limit is too low to process the installation.

The error will say something like, “Fatal error: Allowed memory size of _______ bytes exhausted…” If you see this memory error, it’s easy to fix.

Log into the control panel of your site and open your preferred file editor: FTP or file manager. In the root directory, you’ll find your wp-config.php file. Click on the edit button and add the following line of code:

define( 'WP_MEMORY_LIMIT', '256M' );

Since the default memory limit is usually 64M, this will significantly increase it and help you get your new theme or plugin installed without issue.

6. Exceeding the File Size Limit

Memory isn’t the only thing that can be pushed to its limit when uploading a new WordPress plugin or theme. You may also find that the allowable file size is exceeded. When this occurs, you’ll see a message similar to this:

“The uploaded file exceeds the upload_max_filesize directive in php.ini”

To fix this maximum upload limit, you’ll need to do so through the control panel. Access your directory using either FTP or a file manager. Once you’re in there, locate the wp-admin folder.

Do you see a php.ini file? If not, you’re going to have to create one.

Once you have the php.ini file open, look for a section that mentions “filesize”. If it exists, you’ll want to overwrite it with the following code. If it doesn’t, then enter the following lines of code into the file:

upload_max_filesize = 1000M
post_max_size = 2000M
memory_limit = 3000M
file_uploads = On
max_execution_time = 180

This will give you some more leeway in how large your WordPress theme and plugin files can be. If you’re still experiencing problems with this error, read through Jenni McKinnon’s guide on how to increase the maximum upload limit.

7. Miscellaneous Errors

I’m including this final hodgepodge error type because you never know what types of external conflicts might get in the way of you being able to install a plugin or theme. In my case, it was an old conflict between an SSL certificate and CDN I had on my site.

In a nutshell, here’s what happened:

  1. I bought a new WordPress theme.
  2. I installed the WordPress theme and activated it.
  3. When I uploaded the theme, I received a bunch of error messages about how some of the plugins wouldn’t install. I initially disregarded the message because I didn’t think I was going to use most of the plugins anyway.
  4. As it turns out, before I could customize or use my theme, I had to activate a required plugin from the developer… which would not install. The message below is what I saw.
Plugin or Theme Won't Install - SSL Certificate Error
This was the SSL certificate error I saw.

I’ve had an SSL certificate on my website for over a year and had experienced issues with it in the past. Specifically, it conflicted with the CDN. To resolve the conflict, I asked my web host to get rid of the CDN. As far as I knew, the issue was fixed. (Funny enough, the CDN ended up being the problem here.)

Anyway, after working in conjunction with my web hosting company and the theme developer, we were able to sort out that the error could be bypassed by uploading the plugin files directly into WordPress. I had assumed that an inability to install through the theme upload would mean an inability to install through the normal process. However, the workaround took and I was able to get the plugin installed on my site.

I guess this is my roundabout way of saying that if you encounter an error during the installation of a WordPress plugin or theme, it doesn’t resemble numbers 1 through 6 above, and you’ve tried manually uploading, go to the perceived source of the problem. They should be able to provide you with insights into the problem and spare you the agony of trying to figure it out on your own.

Wrapping Up

So, is there a way to avoid these in the future? Well, using reputable themes and plugins from WordPress developers is a good place to start. Familiarizing yourself with what theme and plugin files should contain is another good thing to have under your belt.

All in all, I think this is probably one of the easier kinds of errors you might end up having to deal with in WordPress. That said, errors are a nuisance you often can’t afford to deal with when they pop up mid-workflow, so make sure you’re well-versed in what the most common errors are and how to go about fixing them.

Download the new Xtreme One WordPress Framework for free and test now!

xtreme-1000x400-150x150With pleasure we can now announce that Xtreme One 1.6 was released as a beta last week! Xtreme One WordPress Framework gives you the freedom to easily create your WordPress Themes. No more inflexible layouts or having to change the code all the time. With the powerful framework you are able to realize your ideas very quickly.

Xtreme One is the world’s only WordPress framework that allows solid, fluid and flexible layouts.

With Xtreme One 1.6 also comes the possibility to adapt Xtreme One Widgets to your own needs or create custom widgets, an example is supplied in /xtreme-blank/ Child Theme. The Grid post widgets now support custom post types. Therefore an infinite number of options are available with just a few clicks to reposition content.

Using the unique content widgets you can integrate any widget in the post editor. Of particular interest would it for portfolio websites, certain posts in multiple columns responsive and fluid.

Xtreme One comes with 15 awesome Widgets, try out all of them and you will be amazed!

You can find more information about the powerful WordPress Framework here!

Download and test it for free

Beta testing ends 30.11.2013!