How To Optimize, Repair or Backup Your WordPress Database

In today’s short tutorial we’ll have a look at how to take care and backup our site’s database. This way we can make sure that our site runs optimally and prevent unexpected data loss.

What is the database?

According to Wikipedia a database is an organised collection of data, generally stored and accessed electronically from a computer system. This means that the WordPress database is the place where all our site’s generated data lives, posts, pages, users, comments and more, everything is stored in it. For more information about the WordPress database you can have a look at this WPBeginner glossary entry, and for an in depth look at the default tables and their relations you can check out the database description in the codex.

From all the above we can easily figure out that the database is pretty important for the well-being of our site, any corruption can result to irreversible loss of data and accumulation of clutter might make queries, and by extension our site, slower. Below we’ll find out how we can backup, optimize and repair our database, to prevent these issues.

To help us with these tasks we will be using the WP-DBManager plugin which is available for free in the WordPress plugin repository.

Read More

How to make a crypto WordPress widget using the CoinMarketCap API

Have you ever wanted to know how to build your own WordPress widget? Have you ever wanted to know how you can use (consume) a third-party API from within your WordPress theme/plugin? Did you answer “yes” to at least one of the questions? If you did, the keep reading because you’re actually learn how to do both.

Read More

Add and display a custom field on WooCommerce

If you have a WordPress site and are interested in selling anything, WooCommerce is most likely the way to go. Powered by Automattic, it is by far the most popular e-commerce plugin available for WordPress. It is supported by a very large community and it’s extended with themes and plugins by many third party authors.

Read More

WordPress and CSS Grid: Building a flexible listing template (2, 3 or 4 columns)

Listing templates are every WordPress theme’s bread and butter. Every type of content needs to be displayed somehow and listing templates are the norm when it comes to showcasing content that falls within the same family, i.e. posts, pages, products, or any kind of other custom post types. We use them extensively here at CSSIgniter with a lot of options like headings, animations, post meta visibility, and more. Our main and most wanted option though is the column number setting, i.e. choosing in how many columns to split the cards each post is contained within.

Read More

Multilingual WordPress sites in 3 minutes with Weglot

Have you ever tried setting up a multilingual WordPress site? If you did, you’ll know it’s no easy feat. You need to translate WordPress-provided strings (okay, these are mostly already translated by the time a new version is released), theme strings, plugins strings. You’d do that with a tool such as Poedit or a WordPress plugin such a Loco Translate (let’s call them “translation plugins”). But then there’s also the dynamic strings, a.k.a. the content. All those words you write yourself through WordPress. Posts, pages, custom fields, widgets, etc. These need a separate kind of WordPress plugin (let’s call them “multilingual plugins”), able to extract them, translate them, and show the appropriate translations depending on the user’s choice of language.

Read More

How to use external React components in your Gutenberg blocks

Gutenberg itself already exposes a lot of components ready to be re-used in our custom blocks. Most of these are located in wp.components and wp.blocks, and they include helpful building blocks for every Gutenberg block: Text Controls, Toggles, Tooltips, Icon Buttons, Tabs, and many many others. Gutenberg’s native component library pretty much has us covered on all basic cases, on every kind of basic UI control we might need but still there are cases where we might need to take it a step further on some kind of more specialized custom block.

Read More

A CSS style guide for the default WordPress media player

As theme authors we’re always striving to give our themes a unique design and marry them to the WordPress ecosystem by trying to provide a unified user experience, to the best possible extent. As WordPress comes with its own widgets, shortcodes, and other components, it’s important for any theme to take them into consideration and style them accordingly to its look and feel.

Most of WordPress’s native components (i.e. widgets or shortcodes) do not come with their own predefined styles (i.e. the Gallery shortcode), but other ones (especially JavaScript based ones) do so (i.e. the Audio player). In this post we’ll see how we can visually customize the default WordPress media player and make it feel at home on our theme.

Read More

How to add custom image sizes to your theme

I can’t stop praising WordPress when it comes to the conveniences it provides. While the approach it takes on things might not suit everyone, every time, for the most part its solutions to common issues are good enough. Once such example is images, and the creation of custom sizes from the originally uploaded one.

Read More

How to convert a GMT/UTC timestamp to local time in WordPress

WordPress goes to great lengths in order to provide us with a localized environment, displaying dates and times in the correct format and even language. However, since it uses its own timezone setting, some native PHP functions are no longer applicable (or don’t return correct results), such as the date() function which returns a date/time string depending on the timezone configuration of PHP itself, ignoring the WordPress setting.

Read More