CAll Us: +1 888-999-8231 Submit Ticket

A Better Abstraction for Content Creation?

Gutenberg's Blocks- A Better Abstraction for Content CreationThe biggest user-facing difference between WordPress’s current editor – the classic editor – and the new Gutenberg editor is the block interface. Gutenberg is a block-based editor. But what is a block? How are blocks different to the classic editor’s familiar editing interface? Why were blocks chosen instead of some other content editing abstraction?

Leaky Abstractions

A web page is composed of HTML, CSS, and JavaScript. HTML structures and contains the content. CSS determines the appearance of the content in a browser. JavaScript can modify almost anything about the page programmatically.

In WordPress, themes and plugins provide much of the HTML, CSS and JavaScript, but a large part of the HTML is based on the content that the user adds to a post or page.

WordPress users don’t often interact directly with a post’s HTML. It is possible to write content in HTML, wrapping it in the required tags, but it’s inconvenient for everyone and challenging for users who don’t know HTML. The classic editor is an abstraction from the HTML that makes it easier to write and publish content.

The user writes their post, adds images, and applies formatting. WordPress takes care of translating the representation the user sees into the HTML that it and browsers can work with, and back again for further editing. It’s surprisingly difficult to get this right — the organizations that build web browsers spend millions of dollars to hire the smartest developers to work on HTML parsing. There are many ways to cause issues when transitioning between representations.

That’s one of the reasons the text in the editor doesn’t always behave as you might expect it to. Occasionally, users are forced to edit the HTML directly because of formatting glitches, incorrect addition of white spacing, and other difficulties.

The classic editor is a leaky abstraction. Its job is to abstract away the complexities of the underlying HTML, but those complexities are not hidden as well as they might be. The editing experience is affected and constrained by the HTML representation.

The leakiness of the abstraction becomes even more apparent where shortcodes are concerned. Shortcodes are snippets of code that add functionality or content to the page, but they bear little relation to an ideal editing experience. They provide no clue about what they do. There is no obvious visual representation of their functionality.

Blocks Are a More Watertight Abstraction

The classic editor gives users the abstraction of a post, which has an occasionally uncertain relationship with the HTML that WordPress relies on. In Gutenberg, we have the block instead.

A block is a unit of content that provides an intuitive user experience. What the users see in the interface is everything that they should need to know about a block. There is no HTML lurking behind it to cause problems. Blocks encapsulate their functionality and its presentation, allowing users to focus on the content while WordPress takes care of the hidden complexity.

As the Gutenberg Handbook puts it:

“The main point is to let the machines work at what they are good at, and optimize for the user and the document.”

In Gutenberg, everything is a block that lives in the framework of the post or page. There are simple rules for adding new blocks, moving blocks around in relation to each other, and configuring their behavior.

Of course, there is a great deal of complexity hidden behind the interface visible to the user. Web browsers don’t understand blocks; they understand HTML, CSS, and JavaScript. Blocks have to be turned into a browser-friendly format at some point.

But that point isn’t while the user is interacting with them. While they are being edited, posts with blocks are kept in memory as a complex tree-like data structure containing content and configurations. When stored to disk, the data is serialized as the HTML that WordPress and plugins expect. There is a back-and-forth translation between the block data structure and HTML, but it is not something the WordPress user needs to think about.

There are trade-offs in any significant change, and some WordPress users regret that Gutenberg’s editing interface is several steps removed from the final HTML output, but for most WordPress users, Gutenberg is a long-awaited improvement.

Posted in:
WordPress

Source link

What’s New In WordPress 5.0?

What's New In WordPress 5.0?WordPress 5.0 has been released, and for many site owners, the question of whether it’s worth upgrading is towards the top of their list.

While we’re not going to force you to make a decision – our hosting solutions give you the option of when you want to upgrade your CMS – we are going to present you with some of the new features that come with WordPress 5.0.

WordPress 5.0 Is Gutenberg

WordPress releases often introduce significant changes and new features, but WordPress 5.0 outdoes past major version bumps in scope and impact. WordPress 5.0 is the Gutenberg release.

The Gutenberg editor has consumed the attention of the WordPress community since it was first mooted in 2016. It has been available as a feature plugin for almost two years. With the forthcoming release of WordPress 5.0, Gutenberg will be the default editor. When you update, your WordPress site’s editor will be very different, although you can go back to the classic editor if you choose.

Gutenberg is the focus of WordPress 5.0, but there are other noteworthy changes, including a new theme with Gutenberg support and the usual mix of small fixes and security patches.

What Does the New Gutenberg Editor Mean?

Gutenberg is a block-based editor. Blocks contain content such as paragraphs and images, and they replace shortcodes. Think of blocks as standalone units of content that can be moved around the page to create custom layouts. Writing in Gutenberg is nothing like writing in the classic editor: it’s more powerful, more flexible, and more intuitive. But it does take some getting used to.

Gutenberg is more than an evolution of the user interface. It has a profound impact on all areas of WordPress, particularly themes and plugins, which may need to be edited for compatibility. Many theme and plugin developers have made the necessary changes, but some have not. Before upgrading a production WordPress site or WooCommerce store to WordPress 5.0, run tests on a dev or staging site. Testing will bring to light theme and plugin compatibility problems and other regressions.

  See how Hostdedi Dev Sites help you to quickly create development and staging environments for testing.

Gutenberg is the default editor in WordPress 5.0, but you are not required to use it. The Classic Editor replaces Gutenberg with the familiar editing experience.

You should plan to update even if you don’t want to use Gutenberg. It’s not necessary to update immediately. WordPress 4.9 will be supported for some time to come, but Gutenberg is here to stay and declining to update to avoid Gutenberg is not a viable long-term strategy. If you don’t want to use Gutenberg, it is best to update and then install the Classic Editor plugin.

A New Automattic Theme: Twenty Nineteen

WordPress 5.0 Gutenberg New Theme

The Twenty Nineteen theme is a simple Gutenberg-compatible theme. It is based on the Underscores framework and the gutenberg-starter-theme. Twenty Nineteen is among the plainer default themes of recent years, with a single-column layout, no support for sidebars, and a single navigation menu (plus a social links menu).

If you want to download Twenty Nineteen for implementing changes on a local environment,  you can grab a development version for testing from the project’s GitHub repository.

What Else Is New?

In addition to Gutenberg, WordPress 5.0 will come packed with several other new features. Here are some highlights.

  • Improvements to the WordPress Rest API. The rest API is designed to make a developers life easier by optimizing the ability to send and pull data from a WordPress site. 5.0 will make this even easier.
  • Custom Theme Development. In addition to the Twenty Nineteen theme, there will be a huge number of other themes available, and the ability for developers to make new ones will become even easier. Blocks will make theme development much more intuitive and not require a development background.
  • Improved Responsive Design. Yes, it’s been a concern for many for a long time, but WordPress 5.0 and the Gutenberg editor’s row and column feature will make responsive design better.

Tables with WordPress Gutenberg

  Start a high-performance, high-reliability WordPress site with Hostdedi. Now with 75% OFF.

Will WordPress 5.0 Affect My Current Site?

There have been reports of WordPress 5.0 installs breaking some websites. This is either due to an incompatibility with themes or plugins. 

Several developers have been hard at work trying to update their themes and plugins, and the coming months with continue to see an increase in compatibility. Thanks to Automattic releasing 5.0 in advance, many of the most popular plugins and themes are already compatible with the new iteration.

If you’re unsure if your website will be compatible, we highly recommend spinning up a dev environment and testing the new version before going live.

The Future of Gutenberg

At this year’s WordCamp US – the largest meeting of the WordPress Community – Matt Mullenweg talked about the future of WordPress and where it would be going. This includes 4 stages. Stage 1 was the release of 5.0.

Stage 2 – Focus on theme and plugin customization.

Stage 3 – Focus on creating a collaboration workspace.

Stage 4 – Focus on official support for multilingual sites.

In addition to these phases, the team behind WordPress have also talked about aiming for two updates every month. This should mean a series of minor updates along the way to add functionality and improve any issues users find.

Are You Ready for WordPress 5.0?

Despite worry from the community, 5.0 expands on the functionality of WordPress and helps to bring a lot of advanced features to more people. We’re looking forward to seeing WordPress continue to develop.

If you would like to get started with WordPress Gutenberg, you can follow our guide to Gutenberg to learn about the new block editor and how to create content experiences your audience will love.

Posted in:
WordPress

Source link

Building An Appointment Booking System With WordPress

Building An Appointment Booking System With WordPressManaging appointments is one of the biggest overheads for service-oriented small businesses. Businesses that handle appointments manually often hire one or more employees to book appointments, schedule staff, make reminder calls, and a host of other administrative tasks that go along with scheduling a busy office.

The personal touch is important, but managing appointments the old-fashioned way is expensive and inefficient. It’s also prone to errors, with double-bookings and missed sessions a common occurrence for many businesses. Forward-looking businesses automate the appointment booking process, reducing costs and errors.

The ideal appointment booking service is almost entirely automated. A client decides to make an appointment and visits the business’s website. They’re presented with a calendar that includes available appointment slots. They choose the slot that is most appropriate for them, and perhaps enter payment details. The system adds the appointment to the professional’s calendar, sends a confirmation to the client, and also sends one or more reminders on the day of the appointment.

WordPress is capable of doing all of this, in addition to being an excellent content management system on which to build a small-business lead generation site.

The Ideal Appointment Booking System

There is a basic set a functionality that all customer-facing scheduling systems should provide.

  • An intuitive calendar interface that clients can use to choose an appointment date and time. It should be easy to use and not expect too much technical ability from clients.
  • Multiple calendars for managing appointments for several professionals and for different appointment types.
  • Automated reminders: it’s been shown that sending automated email or SMS reminders significantly reduces no-shows.
  • Integration with other calendaring services: professionals may prefer to use their mobile device’s native calendar or a cloud calendar such as Google Calendar.

Because WordPress is such a popular business content management system, there are many appointment scheduling plugins to choose from. We’ll have a look at two of the most popular: BirchPress Scheduler and Appointment Calendar.

BirchPress Scheduler is a premium appointment booking plugin that ticks all the boxes. It provides an easy-to-use customizable booking form that can be embedded in any WordPress post or page, and configurable email notifications and reminders. BirchPress can also be used to take credit card payments with PayPal or other payment gateways via WooCommerce integrations.

For newer businesses without the budget to pay for BirchPress, Appointment Calendar is a viable alternative with a free option that would suit most small businesses. Appointment Calendar provides a mobile-friendly booking calendar with email notifications. The premium version of the plugin adds many more features, including unlimited staff and services, Google Calendar sync, email reminders, and payment gateway integration.

Neither of the plugins we have looked at includes native SMS integration, but if you would like to send SMS notifications to clients, the WP Twilio Core plugin provides text messaging functionality via the popular Twilio platform.

WordPress, when combined with performance-optimized WordPress hosting and one of the scheduling plugins we have looked at, is a complete website solution for any appointment-based enterprise.

Posted in:
WordPress

Source link

Cookies, WordPress, And The GDPR

Cookies, WordPress, And The GDPRThe web was created to deliver documents to browsers. At first, there was no mechanism for maintaining state to keep track of information between requests. Without state, WooCommerce shopping carts, the WordPress admin interface, and other interactive web experiences couldn’t work.

The cookie was introduced so that the web could remember, but a web that can remember what is in your shopping cart can also remember who you are. Cookies are used by site owners to track us on their site and by advertising companies to track us across hundreds of sites.

With enough information, cookies — small files containing a unique code — can identify individuals and keep track of them as they move around the web. Because cookies are a form of personally identifiable information, they fall under the scope of the GDPR.

In this article, I’m going to focus on cookies, which are a specific technique for maintaining state and identifying users. It’s important to note that the GDPR applies to all technologies that play the same role, not just cookies. You can’t get around the GDPR by using the Web Cache API to store identifying information, for example.

The Old Cookie Regime

The GDPR is not the first EU regulation to deal with cookies. We have all seen the cookie warning banners that say something like: “By using this site you consent for cookies to be used”. By continuing to use the site, the visitor gave implicit consent to its cookies. The GDPR is much stricter and implied consent is no longer sufficient, as we’ll discuss.

Essential vs. Non-Essential Cookies

The GDPR doesn’t care about cookies per se. It cares about data that can be used to personally identify individuals. Some cookies aren’t used to identify shoppers: the session cookies used for shopping carts, for example. These “essential” cookies, do not need consent.

Consent

Consent is another word for permission. Under the GDPR, implied consent is not sufficient. Consent has to be active, unambiguous, specific, and modifiable.

For WordPress site owners, that means:

  • Visitors must actively opt-in. Sites that automatically tick opt-in boxes or as users to opt-out are not compliant.
  • Visitors must be able to opt-in or out to each cookie that you plan to store on their computer. For some sites that might be hundreds of cookies. In the first instance, it is acceptable to group cookies by category so that users can opt-out of “social media cookies,” or “analytics cookies,” but they must also be able to opt-in and out for individual cookies.
  • Consent must be modifiable. That means it should be easy for users to change their mind about consent.

Additionally, consent can’t be used as a condition for showing content. The GDPR specifically forbids denying access to content if consent is not given.

Cookies And WordPress

There are a number of plugins to help WordPress site owners manage cookie permissions, including:

These plugins — with a little coding in some cases — can display a consent banner and block the loading of cookies and scripts until after consent has been given.

Getting consent to use cookies is straightforward enough, but it can be a real headache to identify exactly which cookies a site is serving. Many sites include tracking scripts and embeds, which use their own cookies and may include more scripts which use still more cookies, and so on.

Cookiebot is a cloud service with a WordPress plugin that can scan websites to identify the cookies they serve and create a cookie listing that can be used to obtain consent.

Posted in:
WordPress

Source link

Hosting Your Podcast With WordPress

Hosting Your Podcast With WordPressIn the last few years, podcasts have evolved. Once a niche interest, the most popular podcasts are listened to by millions of people. Anyone with an internet connection, a microphone, and something to say can publish a podcast. Businesses use podcasts as part of their content marketing strategy. Popular podcasts attract a significant amount of advertising money, largely because their niche appeal allows for targeted advertising.

But once a podcast has been recorded, it needs to be hosted online. Unlike a blog post, a podcast can’t just be uploaded to a site — that’s a hosted audio file, not a podcast. Before taking a look at the role WordPress plays in podcast hosting, let’s discuss the various components that make up a podcast.

The anatomy of a podcast

Of course, the audio file is the most important part of a podcast. The audio file can be hosted on the same server as a WordPress site, but most podcasters choose to use external file hosting designed for that purpose. Podcast files are large and they can burn through a WordPress hosting account’s bandwidth.

Although a traditional website isn’t strictly necessary for a podcast, most podcasts have a site. It is used to promote the podcast, to display show notes, and a site is necessary if the podcast is to be discoverable by Google and other search engines.

Next is the RSS feed. Just like a blog, a podcast has an RSS feed. But unlike a blog, the feed is an essential part of a podcast. It is unusual for podcast listeners to visit a podcast’s website to listen, instead they use a podcast app’s search tools, which provide results from a podcast directory.

Podcasts are submitted to directories via the RSS feed. Without an RSS feed, there is no directory listing. The RSS feed is also used by podcast apps to list episodes, discover new episodes, and download the podcast’s file.

WordPress provides two of the important parts of a podcast: the website and the RSS feed — three if you also want to host the podcast audio files on a WordPress server.

WordPress and podcasts

The RSS feed for a podcast is a little different to the RSS feed used by a blog: it contains an “enclosure” for the audio file and additional information that isn’t part of the standard feed. Not so long ago, creating a podcast RSS feed was a bit of a pain, but today there are excellent WordPress plugins that will take care of it.

Seriously Simple Podcasting (SSP) is one of the most full-featured podcasting solutions available for WordPress. It makes it easy to create a podcast feed suitable for submission to podcast directories, including iTunes, Stitcher, and Google Play. It also includes a media player, should people want to listen via your WordPress site. The media files can be hosted on any third-party hosting platform or on the site itself. SSP has its own plugin ecosystem, which includes useful additions such as podcast analytics.

WordPress, combined with performance-optimized WordPress hosting and the Seriously Simple Podcasting plugin, provides everything you need to publish your podcasts.

Posted in:
WordPress

Source link

Five Plugin Red Flags WordPress Hosting Clients Need To Know About

Five Plugin Red Flags WordPress Hosting Clients Need To Know AboutThe fact that WordPress is open source and has such a huge, vibrant developer community is great. For the most part, the huge number of plugins available come with the security afforded by millions of downloads, high ratings, and reliable developers who have worked hard to become known figures in the community.

However, not all plugins are safe and automated protections you may rely on, aren’t effective as pointing out which aren’t. This is because a plugin is a package of PHP code that may also contain files such as images or JavaScript. The code in a WordPress plugin has privileged access to the site and its database. Any JavaScript code is trusted by visitor’s browsers. Because of this, it’s important to make sure that it doesn’t contain security vulnerabilities or malware.

Almost all of the most popular plugins in the official repository are perfectly safe. Plugins with many thousands of users are intensely scrutinized and problems come to light quickly. But there are tens of thousands of WordPress plugins and it’s wise to be vigilant.

The best way to find out if a plugin is safe is to check the code, but it isn’t reasonable to expect that of most WordPress hosting clients. This article looks at how you can identify unsafe WordPress plugins without looking at the code, by identifying the top red flags for knowing what to avoid.

1. Is The Plugin From A Reputable Source?

To be safe, you should install plugins from the official repository or from the website of a developer with a good reputation in the community. Google the name of the developer to find out what has been written about their plugins. If you find mostly negative commentary or no information at all, you may want to find an alternative.

Check the version of the WordPress Plugin you're installing

2. Has It Been Updated Recently?

Abandoned plugins don’t get security updates and may be incompatible with your version of WordPress. Even if a plugin has not been abandoned, infrequent updates are a bad sign.

The plugin’s page on the official repository will tell you when it was last updated and which versions of WordPress it is compatible with. Avoid plugins that haven’t been updated in the last few months. Even if an old plugin seems to work properly, there may be hidden issues.

3. Does It Have Ongoing Support?

Does your WordPress Plugin have ongoing supportCheck the support section of the plugin page on WordPress to see if the plugin has continuous and active support. You’ll be able to see how many issues have been identified and how many have been solved by the developer community within the last few months. Moreover, by clicking “view support forum”, you’ll be able to see how active the plugin community has been and how much support it has from other users.

4. Is It A “Free” Premium Plugin?

Many developers of premium plugins also release a free version with limited functionality. It is perfectly fine to use these plugins. But if you find a fully functional premium plugin offered for free, do not install it. Plugin pirates install malware in these so-called “nulled” plugins.

5. Did The Plugin Recently Change Owners?

This isn’t always an indication of a problem: developers sell or transfer plugins for many reasons. But in recent months there have been incidents of popular plugins ending up in the hands of unscrupulous developers.

6. Does the Developer Have a Bad Reputation?

Before installing the plugin, it can be a good idea to check up on the reputation of the developer. A quick google search of their name can merit a lot of results here. Similarly, it can merit nothing at all. This, in itself, can be a red flag and suggest the developer is either new to the WordPress scene or isn’t trusted.

7. Is It Popular With WordPress Users?

Rating of the WordPress plugin on whether it is unsafePlugins with few users are more likely to cause problems. There are millions of WordPress sites, so if only a handful of WordPress users have installed a plugin, you should be cautious. There are a couple of possibilities: the plugin targets a narrow niche or it is being avoided by other WordPress users. It may also be a brand new plugin, but that should be a red flag too.

As a rule, stick to plugins that are installed on lots of WordPress sites: problems are more likely to have been noticed and ironed out.

 

8. Is It Compatible With the Latest WordPress Version?

Checking for updated compatibility is a good step towards being able to judge the reliability and safety of a plugin. The “Requires WordPress Version” will let you know how far back you need to go in order to have the plugin properly work with your website. Making sure you have the latest version is as much about security as it is about optimizing your WordPress site for performance.

Avoid this message for WordPress plugins

Finally, if you happen to see the message above, it’s definitely not a good idea to install the plugin. There’s a reason why the developer hasn’t updated it, and it’s probably not one you want to know.

The WordPress Community Is, In General, Reliable

There are thousands of honest, competent, and generous plugin developers. But there are some bad apples, as there are in any large community. Before installing a plugin, run through these seven simple checks to keep your WordPress site safe.


Blog Post SummaryLooking to get started with WordPress Gutenberg? Learn how to use it with our Guide to Gutenberg. We’ll take you through the entire process of setting up your first page with blocks.

Are you a developer looking to code your own applications with WordPress? Explore the benefits for headless WordPress and see if it’s the right choice for you.


 

Posted in:
WordPress

Source link

Headless WordPress: What Is It?

Headless WordPress- What Is ItIn the years WordPress has been around, we’ve seen it grow from a small community project into one of the largest CMS platforms available; currently powering over 30% of the web. In that time, multiple iterations have risen and fallen, and various developments continue to make waves in the WordPress community – even official ones (Gutenberg, anyone?).

Headless WordPress is one of those developments. A form of Headless CMS, headless WordPress allows for expanded creative freedom by allowing you to adopt an alternate front-end suited to your needs. 

This article will cover what headless WordPress is and some of the benefits and disadvantages of adopting this development style.

What Is Headless WordPress?

WordPress is made up of three parts.

  • A database
  • A layer of PHP code
  • A front-end

On standard WordPress sites, the layer of PHP code interacts with the database to create an admin interface, that content of which is then displayed through the front-end.  

To use WordPress as a headless content management system, you chop off (or bypass) the user-facing front-end and replace it with something else.

A diagram of Headless WordPress

This is possible because WordPress has a REST API that other applications can use to request posts, static files, and other content. In simple terms, the rest API allows for content to be converted into raw data for interpretation by alternate systems.

This means that a developer can build a JavaScript web application that runs in the browser, taking the content stored in WordPress’s database and displaying it in any way the developer sees fit.

But it doesn’t have to be a JavaScript web application: it might be a native mobile app, a desktop app, or any other piece of software that can request content over HTTP and display it to a user.

So it is possible to use WordPress as a headless content management system, but why would you want to?

The Benefits of Headless WordPress

WordPress, in its native form, is already incredibly flexible. However, there are several cases where WordPress doesn’t fit the requirements of a business. In these cases, adding headless capabilities adds to that flexibility in a way that can add value.

You may want to adopt a headless WordPress environment if you:

  • Want to develop in JavaScript or an alternate programming language
  • You’re building a SaaS environment
  • You have a smaller budget but want a customized user-facing website.

These are all great reasons for adopting headless WordPress. To really understand why, we need to look at each in a little more detail.

Develop in JavaScript

Develop with JavaScript on Headless WordPressYou can access the REST API in any language with a HTTP library. However, in practice, headless CMS’s are most often used with JavaScript.

JavaScript is, by some measures, the most popular programming language in the world. Millions of web developers know JavaScript inside out. The same is not true of PHP, the language WordPress is written in.

For this reason, headless WordPress gives front-end developers the powerful content management capabilities of WordPress, without asking them to create WordPress themes or code with WordPress’s API.

Build a PWA With WordPress (SaaS)

Progressive web applications have taken the web development world by storm in the past year. They use modern web technologies to provide web applications with some of the abilities of native applications.  As a result, WordPress renders its pages on the server, but there are advantages to rendering content in the browser.

A PWA can cache content from the API, rendering it instantly on page transitions; cached content works while the device is offline, and PWAs can use push notifications and other niceties typically reserved for native applications.

Build static sites With WordPress

Static websites are a popular alternative to client-rendered web apps. If content doesn’t change rapidly enough to justify dynamic page generation, a static site is a viable alternative. Tools like Gatsby and Next.js can pull content from backends and use them to create a static site. There is a Headless WordPress starter kit based on Next.js, but it is not for the faint of heart.

Use WordPress as the Backend for Anything

Although I’ve concentrated on JavaScript options, a headless WordPress installation can be used as the backend for any project that requires content management, from native applications to corporate intranets to IoT dashboards.

The Drawbacks Of Headless WordPress

A headless WordPress installation has many applications, but it isn’t for everyone. The WordPress front-end and WordPress themes are one of the reasons WordPress is so popular: themes make it possible to quickly get up-and-running with a fast and professional-looking site.

Building a separate front-end for WordPress is much more expensive than simply installing a WordPress theme. It’s really only an option for developers or businesses that are happy to hire a developer.

Headless WordPress is interesting, and it shows just how flexible WordPress has become, but it is likely that only a tiny portion of WordPress’s millions of users will have any need of a headless CMS.

 


Blog Post SummaryInterested in more WordPress?  Check out our guide to Gutenberg, where we cover how to get started with some of the new editor’s most powerful features.

Alternatively, are you looking to optimize WordPress for eCommerce? See if WooCommerce is the right choice before opting for headless WordPress.


 

Posted in:
WordPress

Source link

Which Is Right For You?

If you are anything like me, you have a hard time choosing a WordPress theme for your site. There are thousands of premium themes and even more free themes. I’ve spent many an hour scrolling through theme marketplaces, opening theme pages in dozens of tabs, and scrutinizing demonstration sites – all in an effort to find the perfect theme for a project.

Understanding the types of themes that are available can help you to choose more quickly. One way to categorize themes is as niche or general purpose. Niche themes are designed with a specific type of site in mind, while general themes can be adapted to any site.

General Purpose WordPress Themes

A general-purpose WordPress theme can be thought of as a flexible framework. They can be put to work on blogs, news sites, eCommerce stores, portfolios, or any other type of site.

General or multi-purpose themes can be further divided into themes that include a huge amount of functionality and bare-bones themes. Some of the most popular WordPress themes, such as Divi, Uncode, Avada are heavyweight themes with a complex array of functionality that might include drag-and-drop page builders, multiple sliders, and bundled premium plugins.

At the other end of the spectrum are themes like StudioPress’s Genesis framework, which while powerful and flexible, provides a relatively lightweight framework on which a great site can be built.

Niche WordPress Themes

Niche WordPress themes are pre-tailored to a specific type of site. There is a huge variety of niche themes for every type of site and industry, from law to health and real estate to gyms. Niche themes include features relevant to their niche: for example, the popular Woga theme is designed for Yoga Studios and includes a built-in BMI calculator, a daily schedule, and a design suitable to that type of business.

Which Is Right For Your Project?

Niche themes are inflexible by design, and that makes them simpler to use. You can install them, tweak a few configuration options, add your content, and you are good to go.

Multi-purpose themes are more complex. The best are designed to be easy to use, but you are still expected to mold the theme into a shape that is appropriate to your project. While themes like Avada are user-friendly, the same is not true of barebones multi-purpose themes, which assume familiarity with the WordPress way of doing things.

As the WordPress’s theme recommendations for developers put it: ““General” or “multipurpose” themes are often hard for a new user to set up easily. Consider designing niche themes.”

If flexibility and features are important to you, a multi-purpose WordPress theme is ideal. But if you want a theme tailored to your use-case or you aren’t familiar with WordPress, a niche theme will provide the best experience.

Posted in:
WordPress

Source link

The Right Way To Add Custom Functions To Your WordPress Site

WordPress is rightly famed for the vast array of plugins and themes it makes available to site owners. If you want to add a feature to your WordPress site, you will almost certainly find a plugin that does the job.

But, on occasion, you may find yourself in need of a minor tweak or piece of bespoke functionality that isn’t available as a plugin. The solution is to add a snippet of custom code to the site. WordPress is a PHP application and WordPress plugins and themes are written in the PHP programming language. As a WordPress hosting client, you have access to the same hooks and tools WordPress developers use.

You don’t even have to be a PHP expert to do this. There thousands of pre-made snippets around the web that you can adapt to your own purposes. Take care though, there are security implications to adding code to your site and badly written code can stop your WordPress site from working altogether. Make sure you know what a function does and that it is compatible with your version of WordPress before you add it to your site.

Once you have discovered the need for a function and written it from scratch or adapted a prewritten function, where should you put it?

There is a wrong way and a right way to do this. If you do it the “wrong” way, your function may work initially, but it is likely to stop working when you update your site.

How Not To Add Functions To WordPress

The two most common “bad” ways to add functions are editing an existing plugin or editing the functions.php file.

Don’t edit plugin files. If your snippet changes the functionality of a plugin, it might seem sensible to add the new code directly to the plugin. But, when you update the plugin, the files you have changed will be overwritten and your code will disappear.

The functions.php file is not a general purpose dumping ground for custom code. The functions.php file belongs to your theme. If the code you want to add is theme-specific, then functions.php is a good place to put it. But, when you switch themes, the new theme will not have the custom code. Avoid putting general-purpose custom code in functions.php.

The Right Way To Add Custom Functions

There are a couple of ways to add custom functions that will last beyond your next update or theme switch.

The Code Snippets Plugin

The Code Snippets plugin is designed for exactly this purpose. It provides a graphical interface for adding code snippets to a WordPress site. You can add as many snippets as you want, enable and disable them easily, and export them in a format that can be imported into other WordPress sites with the Code Snippets plugin.

Build A Custom Plugin

You might find the idea daunting, but it is not difficult to build a custom plugin that can be installed on a WordPress site alongside third-party plugins.

The basic structure of a minimal plugin looks like this:

  • A folder with the same name as your plugin, e.g. my-plugin. This is not essential but it’s useful if you want to add more files in the future.
  • A PHP file inside that folder called my-plugin.php

In the my-plugin.php file, add the following text:

<?php
/*
Plugin Name: Example Plugin
*/


That is essentially all you need to create a plugin, although it won’t do anything yet. To make it useful, you need to add your custom function to the PHP file and then upload the folder to the plugin directory of your WordPress site, usually wp-content/plugins/.

If you need to add new functions, you can simply overwrite the old version with your changes.

For more information about creating custom WordPress plugins, take a look at the Writing a Plugin guide in the ever useful WordPress Codex.

Posted in:
WordPress

Source link