.NET and WebAssembly – Is this the future of the front-end?

6 years ago Erik Meijer and I were talking about how JavaScript is/was an assembly language. It turned into an interesting discussion/argument (some people really didn’t buy it) but it still kept happening. Currently WebAssembly world is marching forward and is supported in Chrome, Firefox, and in Development in Edge, Opera, and Safari.

“The avalanche has begun, it’s too late for the pebbles to vote.” – Ambassador Kosh

Today in 2017, WebAssembly is absolutely a thing and you can learn about it at http://webassembly.org. I even did a podcast on WebAssembly with Mozilla Fellow David Bryant (you really should check out my podcast, I’m very proud of it. It’s good.)

The classic JavaScript TODO app, written with C# and .NET and Blazor

The image above is from Steve Sanderson’s NDC presentation. He’s writing the classic client-side JavaScript ToDo application…except he’s writing the code in C#.

What is WebAssembly?

“WebAssembly or wasm is a low-level bytecode format for in-browser client-side scripting, evolved from JavaScript.” You can easily compile to WebAssembly from C and C++ today…and more languages are jumping in to include WebAssembly as a target every day.

Since I work in open source .NET and since .NET Core 2.0 is cross-platform with an imminent release, it’s worth exploring where WebAssembly fits into a .NET world.

Here’s some projects I have identified that help bridge the .NET world and the WebAssembly world. I think that this is going to be THE hot space in the next 18 months.

WebAssembly for .NET

Despite its overarching name, this OSS project is meant to consume WASM binary files and execute them from within .NET assemblies. To be clear, this isn’t compiling .NET languages’ (C#, VB.NET, F#) into WebAssembly, this is for using WebAssembly as if it’s any other piece of resuable compiled code. Got an existing WASM file you REALLY want to call from .NET? This is for that.

Interestingly, this project doesn’t spin up a V8 or Chakra JavaScript engine to run WASM, instead it reads in the bytecode and converts them to .NET via System.Reflection.Emit. Interesting stuff!

Mono and WebAssembly

One of the great things happening in the larger .NET Ecosystem is that there is more than one “.NET” today. In the past, .NET was a thing that you installed on Windows and generally feared. Today, there’s .NET 4.x+ on basically every Windows machine out there, there’s .NET Core that runs in Docker, on Mac, Windows, and a dozen Linuxes…even Raspberry Pi, and Mono is another instance of .NET that allows you to run code in dozens of other platforms. There’s multiple “instances of .NET” out there in active development.

The Mono Project has two prototypes using Mono and WebAssembly.

The first one uses the traditional full static compilation mode of Mono, this compiled both the Mono C runtime and the Mono class libraries along with the user code into WebAssembly code. It produces one large statically compiled application. You can try this fully statically compiled Hello World here. The full static compilation currently lives here.

So that’s a totally statically compiled Hello World…it’s all of Mono and your app into Web Assembly. They have another prototype with a difference perspective:

The second prototype compiles the Mono C runtime into web assembly, and then uses Mono’s IL interpreter to run managed code. This one is a smaller download, but comes at the expense of performance. The mixed mode execution prototype currently lives here.

Here they’ve got much of Mono running in Web Assembly, but your IL code is interpreted. One of the wonderful things about Computer Science – There is more than one way to do something, and they are often each awesome in their own way!

“Blazor” – Experimental UI Framework running .NET in the browser

With a similar idea as the Mono Project’s second prototype, Steve Sanderson took yet another “instance of .NET,” the six year old open source DotNetAnywhere (DNA) project and compiled it into Web Assembly. DNA was an interpreted .NET runtime written in portable C. It takes standard IL or CIL (Common Intermediate Language) and runs it “on resource-constrained devices where it is not possible to run a full .NET runtime (e.g. Mono).” Clever, huh? What “resource-constrained device do we have here six years later?” Why, it’s the little virtual machine that could – the JavaScript VM that your browser already has, now powered by a standard bytecode format called WebAssembly.

To prove the concept, Steve compiles DotNetAnywhere to WASM but then takes it further. He’s combined standard programming models that we see on the web with things like Angular, Knockoutjs, or Ember, except rather than writing your web applications’ UI in JavaScript, you write in C# – a .NET language.

Here in the middle of some Razor (basically HTML with C# inline) pages, he does what looks like a call to a backend. This is C# code, but it’ll run as WASM on the client side within a Blazor app.

@functions {
WeatherForecast[] forecasts;

override protected async Task InitAsync()
{
using (var client = new HttpClient())
{
var json = await client.GetStringAsync(AbsoluteUrl("/api/SampleData/WeatherForecasts"));
forecasts = JsonUtil.Deserialize<WeatherForecast[]>(json);
}
}
}

This would allow a .NET programmer to use the same data models on the client and the server – much like well-factored JavaScript should today – as well as using other .NET libraries they might be familiar or comfortable with.

Why do this insane thing? “To see how well such a framework might work, and how much anyone would care.” How far could/should this go? David Fowler already has debugging working (again this is ALL prototypes) in Visual Studio Code. Don’t take my word for it, watch the video as Steve presents the concept at the NDC Conference.

Blazor as a prototype has a number of people excited, and there was a Blazor Hackthon recently that produced some interesting samples including a full-blown app.

Other possibilities?

There’s lots of other projects that are compiling or transpiling things to JavaScript. Could they be modified to support WebAssembly? You can take F# and compile it to JavaScript with F#’s Fable project, and some folks have asked about WebAssembly.

At this point it’s clear that everyone is prototyping and hacking and enjoying themselves.

What do YOU think about WebAssembly?


© 2017 Scott Hanselman. All rights reserved.
     

6 years ago Erik Meijer and I were talking about how JavaScript is/was an assembly language. It turned into an interesting discussion/argument (some people really didn't buy it) but it still kept happening. Currently WebAssembly world is marching forward and is supported in Chrome, Firefox, and in Development in Edge, Opera, and Safari.

"The avalanche has begun, it's too late for the pebbles to vote." - Ambassador Kosh

Today in 2017, WebAssembly is absolutely a thing and you can learn about it at http://webassembly.org. I even did a podcast on WebAssembly with Mozilla Fellow David Bryant (you really should check out my podcast, I'm very proud of it. It's good.)

The classic JavaScript TODO app, written with C# and .NET and Blazor

The image above is from Steve Sanderson's NDC presentation. He's writing the classic client-side JavaScript ToDo application...except he's writing the code in C#.

What is WebAssembly?

"WebAssembly or wasm is a low-level bytecode format for in-browser client-side scripting, evolved from JavaScript." You can easily compile to WebAssembly from C and C++ today...and more languages are jumping in to include WebAssembly as a target every day.

Since I work in open source .NET and since .NET Core 2.0 is cross-platform with an imminent release, it's worth exploring where WebAssembly fits into a .NET world.

Here's some projects I have identified that help bridge the .NET world and the WebAssembly world. I think that this is going to be THE hot space in the next 18 months.

WebAssembly for .NET

Despite its overarching name, this OSS project is meant to consume WASM binary files and execute them from within .NET assemblies. To be clear, this isn't compiling .NET languages' (C#, VB.NET, F#) into WebAssembly, this is for using WebAssembly as if it's any other piece of resuable compiled code. Got an existing WASM file you REALLY want to call from .NET? This is for that.

Interestingly, this project doesn't spin up a V8 or Chakra JavaScript engine to run WASM, instead it reads in the bytecode and converts them to .NET via System.Reflection.Emit. Interesting stuff!

Mono and WebAssembly

One of the great things happening in the larger .NET Ecosystem is that there is more than one ".NET" today. In the past, .NET was a thing that you installed on Windows and generally feared. Today, there's .NET 4.x+ on basically every Windows machine out there, there's .NET Core that runs in Docker, on Mac, Windows, and a dozen Linuxes...even Raspberry Pi, and Mono is another instance of .NET that allows you to run code in dozens of other platforms. There's multiple "instances of .NET" out there in active development.

The Mono Project has two prototypes using Mono and WebAssembly.

The first one uses the traditional full static compilation mode of Mono, this compiled both the Mono C runtime and the Mono class libraries along with the user code into WebAssembly code. It produces one large statically compiled application. You can try this fully statically compiled Hello World here. The full static compilation currently lives here.

So that's a totally statically compiled Hello World...it's all of Mono and your app into Web Assembly. They have another prototype with a difference perspective:

The second prototype compiles the Mono C runtime into web assembly, and then uses Mono’s IL interpreter to run managed code. This one is a smaller download, but comes at the expense of performance. The mixed mode execution prototype currently lives here.

Here they've got much of Mono running in Web Assembly, but your IL code is interpreted. One of the wonderful things about Computer Science - There is more than one way to do something, and they are often each awesome in their own way!

"Blazor" - Experimental UI Framework running .NET in the browser

With a similar idea as the Mono Project's second prototype, Steve Sanderson took yet another "instance of .NET," the six year old open source DotNetAnywhere (DNA) project and compiled it into Web Assembly. DNA was an interpreted .NET runtime written in portable C. It takes standard IL or CIL (Common Intermediate Language) and runs it "on resource-constrained devices where it is not possible to run a full .NET runtime (e.g. Mono)." Clever, huh? What "resource-constrained device do we have here six years later?" Why, it's the little virtual machine that could - the JavaScript VM that your browser already has, now powered by a standard bytecode format called WebAssembly.

To prove the concept, Steve compiles DotNetAnywhere to WASM but then takes it further. He's combined standard programming models that we see on the web with things like Angular, Knockoutjs, or Ember, except rather than writing your web applications' UI in JavaScript, you write in C# - a .NET language.

Here in the middle of some Razor (basically HTML with C# inline) pages, he does what looks like a call to a backend. This is C# code, but it'll run as WASM on the client side within a Blazor app.

@functions {

WeatherForecast[] forecasts;

override protected async Task InitAsync()
{
using (var client = new HttpClient())
{
var json = await client.GetStringAsync(AbsoluteUrl("/api/SampleData/WeatherForecasts"));
forecasts = JsonUtil.Deserialize<WeatherForecast[]>(json);
}
}
}

This would allow a .NET programmer to use the same data models on the client and the server - much like well-factored JavaScript should today - as well as using other .NET libraries they might be familiar or comfortable with.

Why do this insane thing? "To see how well such a framework might work, and how much anyone would care." How far could/should this go? David Fowler already has debugging working (again this is ALL prototypes) in Visual Studio Code. Don't take my word for it, watch the video as Steve presents the concept at the NDC Conference.

Blazor as a prototype has a number of people excited, and there was a Blazor Hackthon recently that produced some interesting samples including a full-blown app.

Other possibilities?

There's lots of other projects that are compiling or transpiling things to JavaScript. Could they be modified to support WebAssembly? You can take F# and compile it to JavaScript with F#'s Fable project, and some folks have asked about WebAssembly.

At this point it's clear that everyone is prototyping and hacking and enjoying themselves.

What do YOU think about WebAssembly?



© 2017 Scott Hanselman. All rights reserved.
     

24 Best WordPress Themes for Bed and Breakfasts

Are you looking to create a bed and breakfasts website on WordPress? There are plenty of WordPress themes designed to work specifically for bed and breakfasts. In this article, we have hand-picked some of the best WordPress themes for bed and breakfasts that you can… Read More »

The post 24 Best WordPress Themes for Bed and Breakfasts appeared first on WPBeginner.

Are you looking to create a bed and breakfasts website on WordPress? There are plenty of WordPress themes designed to work specifically for bed and breakfasts. In this article, we have hand-picked some of the best WordPress themes for bed and breakfasts that you can try.

Best WordPress themes for bed and breakfasts

Building a Bed and Breakfast Website with WordPress

WordPress is used by thousands of bed and breakfasts, hotels, lodges, spas, and other businesses in the hospitality industry.

Its flexibility, design options, and integrations make it the perfect tool to build modern mobile friendly websites.

Before getting started, first you need to make sure that you are using the right platform for the job (WordPress.org). See our comparison of WordPress.com vs WordPress.org to see why we recommend self-hosted WordPress.org.

Next, you’ll need to signup for a WordPress hosting account. This is where your website files are stored.

We recommend using Bluehost because they are one of the largest hosting companies in the world and an officially recommended WordPress hosting provider.

Luckily, they have agreed to offer WPBeginner users 60% discount on hosting with free domain name + SSL. Click here to start with Bluehost.

After signing up for hosting, you are now ready to install WordPress. Visit our step by step guide on how to make a website, and you’ll be up and ready to go in no time.

Now that you are ready, let’s look at some of the best WordPress themes for bed and breakfasts that you can use on your website.

1. Dreamy

Dreamy

Dreamy is a beautifully designed WordPress theme for bed and breakfasts, spas, resorts and hotels. With a modern and elegant design, Dreamy comes with extensive booking functionality with ready to use templates.

It also includes beautiful sliders, weather widget, highly customizable homepage, and 100+ shortcodes. It is very easy to setup and customize with theme options panel.

2. Milos

Milos

Milos is designed specifically for hotels, bed and breakfasts, and restaurants. It is tested to work beautifully with third-party booking plugins and websites. The homepage features a modern design with a fullscreen slider and a call to action.

It is highly customizable with unlimited color controls, room page templates, social media menus, and more. Inside you will also find a restaurant menu management system to showcase breakfast and dining options available at your bed and breakfast.

3. Parador

Parador

Parador is an elegant WordPress theme for bed and breakfasts, hotels, and similar businesses. It comes with an integrated hotel room booking system that allows visitors to book rooms directly. You get beautiful templates for room pages with photo galleries and sliders.

Inside you will also find testimonials section, social media integration, custom logo support, and unlimited colors. All theme options can be easily configured using theme options panel and customizer.

4. Riverside Resort

Riverside Resort

Riverside Resort is another great WordPress theme for resorts, bed and breakfasts, and hotels. It has a booking form allowing your customers to book rooms or services without leaving your website. It also makes it easy to add room descriptions and photo galleries.

Riverside Resort comes with ready-made templates for spa, meetings, and rooms. You can also use the 1-click installer to import the demo content. It has custom widgets for social media, weather, Google Maps, contact form, and more.

5. Sundance

Sundance

Sundance WordPress theme is another excellent option for a bed and breakfast website. It has custom map, weather, and contact us widgets that you can place at the top. It has a rooms section, which allows you to add available accommodation options with photos.

You can use the built-in functionality to add a blog to your website to engage with your community.

You’ll find it easy to use and setup. It allows you to import demo content and use it as a starting point. All theme options can be easily changed using theme settings and customizer.

6. Haven

Haven

Haven is a highly flexible WordPress theme for bed and breakfasts and hotels. Packed inside are three ready-made demos that you install with 1-click. Each demo website comes with complete content that you can replace with your own to get started. It supports external booking systems like AirBnB, Booking.com, Expedia, and more.

It also has an integrated visual page builder that allows you to create your own page layouts with simple drag and drop. The theme has tons of customization choices with layout styles, colors, header styles, background, and sliders.

7. Paris

Paris

Paris is a sophisticated WordPress theme suitable for hotels, B&B, spas, and travel websites. It comes with plenty of customization options that you’ll expect from a premium theme. It includes a shortcode generator, multiple sidebars, custom widgets, mega menus, and more.

It comes with an easy to use section to add rooms and services. Room templates are beautifully designed with large photo galleries. It is easy to setup with a custom theme options panel which even allows you to add Google Analytics and Google Search Console code to your website.

8. Hotelia

Hotelia

Hotelia is a modern and powerful WordPress theme for hotels with a great set of premium features. It has a fully functional room search feature which allows users to select dates to look for rooms. You can also use Hotelia to build a custom booking website of your own.

It features a modern homepage style that you can setup using theme options panel. It also ships with premium WordPress slider plugin and a drag and drop page builder.

9. HotelEngine Comfy

HotelEngine Comfy

Comfy is a powerful WordPress theme for hotels, B&B, vacation rentals, and similar businesses. It includes a powerful booking engine that allows you to easily manage your property. It is beautifully designed with a slider on top, which is followed by your booking form, rooms, map widget, and more.

It is easy to customize and comes with its own custom theme options panel. Inside you’ll also find multiple sidebars, color schemes, social media integration, and more.

10. SixtyOne

SixtyOne

SixtyOne is another easy to use and super flexible WordPress theme for B&B, resorts, and hotels. It comes with customizable homepage layout allowing to easily display amenities, add slider, and drag and drop widgets.

It also has a fully integrated booking request form with a custom section to add rooms, testimonials, and photo galleries. It has beautiful templates to showcase rooms, room category, contact form page, and more. All theme options can be easily changed using live customizer.

11. Imperial

Imperial

Imperial is a simple WordPress theme designed for bed and breakfast, hostels, and other hospitality businesses. It includes a testimonials section, accomodation template, multiple sidebars, and full-width page template.

Imperial’s main feature is its simplicity and ease of use. The homepage layout features a slider on top followed by rooms and services and a footer widget area. All theme options are available under theme customizer.

12. Courtyard

Courtyard

Courtyard is a free WordPress theme for bed and breakfasts, resorts, and spas. It has a sticky floating navigation menu on top, a fullscreen slider on the homepage, followed by your rooms and services sections.

It is fully customizable using live customizer and works well with popular contact form plugins you want to use for bookings.

13. Palermo

Palermo

If you are looking for classy and elegant WordPress theme for B&B, resort, or hotel, then you’ll like Palermo. This beautifully crafted WordPress theme features a traditional two column layout. The left column remains on screen and it contains your site logo, navigation menus, and social buttons.

It has beautiful templates for your room pages, testimonials, amenities, and photo galleries. Theme customization is super easy with 30 appearance options and style combinations.

14. Ultra

Ultra

Ultra is a powerful multipurpose WordPress business theme designed to work for any kind of business website. It comes with several readymade websites with demo content and 60+ pre-designed layouts. This gives you a good starting point to build your website. It also has an integrated drag and drop builder so you can easily modify the pre-designed layouts or even create your own layouts from scratch.

Despite packing so many features, Ultra is very easy to use and comes an intuitive theme options panel. This allows you to easily setup your website by simply toggling buttons and entering plain text.

15. Indigo

Indigo

Indigo is a beautifully crafted multipurpose WordPress theme for business websites. It has multiple readymade websites with demo content. You can install these websites with 1-click and modify them to meet your needs.

Indigo is easy to use and comes with modules that you can just drag and drop on your pages to add different elements. It is translation ready and comes with full WooCommerce support.

16. Santorini Resort

Santorini

Santorini Resort is a uniquely designed WordPress theme for resorts, hotels, and bed and breakfasts. It includes sections to easily add rooms, gallery, videos, services, and attractions. It has a flexible homepage with widget areas, which allows you to just drag and drop content widgets to set it up.

The theme also comes with a booking request form. You can also use any WordPress form builder plugin to create your own forms as well.

17. Lighthouse

Lighthouse

Lighthouse is a colorful and free WordPress theme suitable for travel, hotels, B&B websites. It features an elegant landing page with a fullwidth header image. It has multiple widget ready areas, two navigation menus, and color customization features.

It also has beautiful templates for galleries, blog posts, and full-width pages. All theme options are conveniently located under theme customizer.

18. Olympus Inn

Olympus Inn

Olympus is another modern WordPress B&B theme. Its homepage features a beautiful large slider with a booking form overlay and call to action button. It has a very modern and look to it that makes your website standout.

It is packed with customization options and has sections to easily add rooms, attractions, image galleries, and testimonials. The homepage layout is easy to setup with a drag and drop layout builder.

19. Cortina

Cortina

Designed specifically for B&B and hotels, Cortina is a modern WordPress theme. It has an integrated booking form on all room pages. It comes with unlimited color schemes, sidebars, and page layouts allowing you to customize the look and appearance of the theme to match your brand.

It has beautiful templates for galleries, fullwidth page, toggle, accordion FAQs, and tabs. Theme setup is quite simple and you’ll be able to get up and running in no time.

20. Narcos

Narcos

Narcos is a versatile WordPress multipurpose theme for businesses. It has a modern homepage layout which makes it perfect for B&B website. It has built-in sections for testimonials, portfolio, services, and staff profiles.

The homepage has a fullscreen slider, parallax background effect, CSS3 animations, and a modular layout. Theme setup is quite easy and you’ll have plenty of options to change anything you like. It can also be used to add an online store to your website.

21. Aegean Resort

Aegean Resort

Need bright colors and spacious layout for your bed and breakfast website? Check out Aegean. This beautifully designed simple WordPress theme is a mix of minimalism and functionality. It includes a booking form, weather widget, location, and beautiful templates for rooms.

It is quite simple to use as well. The homepage layout is easy to setup by just adding content widgets to the theme. It has multiple custom widgets for content and social media integration.

22. Presence

Presence

Presence is a WordPress business theme with a built-in demo for hotel website. This hotel demo comes with a booking form, room templates, attractions section, and Google Maps support.

It is packed with features like multiple layout choices, sidebars, header styles, 6 color schemes, and more. It is ready for WooCommerce and can be used on multilingual websites using WPML.

23. Zermatt

Zermatt

Zermatt is a stunningly beautiful WordPress theme for hotels and bed and breakfasts. It has beautiful transparent navigation menu with a weather widget on top. The homepage setup is made up of different widget ready areas. Zermatt includes several custom widgets, which you can just drag and drop to setup homepage.

It also has beautiful sliders, photo galleries, page templates, and of course a booking form. You’ll like its ease of use and professional appearance.

24. Marea

Marea

Marea is designed for holiday homes, vacation rentals, B&Bs, and similar businesses. Featuring a modern layout, this WordPress theme is packed with all the features you’ll need to quickly setup your website. It has unlimited color choices and Google Fonts support.

You can get started with 1-click demo content installer and then replace content with your own. Choose your own branding to customize the theme and you’ll be all set.

We hope this article helped you find the best WordPress theme for bed and breakfasts. You may also want to see our list of essential WordPress plugins for business websites.

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 24 Best WordPress Themes for Bed and Breakfasts appeared first on WPBeginner.

24 Best WordPress Themes for Bed and Breakfasts

Are you looking to create a bed and breakfasts website on WordPress? There are plenty of WordPress themes designed to work specifically for bed and breakfasts. In this article, we have hand-picked some of the best WordPress themes for bed and breakfasts that you can… Read More »

The post 24 Best WordPress Themes for Bed and Breakfasts appeared first on WPBeginner.

Are you looking to create a bed and breakfasts website on WordPress? There are plenty of WordPress themes designed to work specifically for bed and breakfasts. In this article, we have hand-picked some of the best WordPress themes for bed and breakfasts that you can try.

Best WordPress themes for bed and breakfasts

Building a Bed and Breakfast Website with WordPress

WordPress is used by thousands of bed and breakfasts, hotels, lodges, spas, and other businesses in the hospitality industry.

Its flexibility, design options, and integrations make it the perfect tool to build modern mobile friendly websites.

Before getting started, first you need to make sure that you are using the right platform for the job (WordPress.org). See our comparison of WordPress.com vs WordPress.org to see why we recommend self-hosted WordPress.org.

Next, you’ll need to signup for a WordPress hosting account. This is where your website files are stored.

We recommend using Bluehost because they are one of the largest hosting companies in the world and an officially recommended WordPress hosting provider.

Luckily, they have agreed to offer WPBeginner users 60% discount on hosting with free domain name + SSL. Click here to start with Bluehost.

After signing up for hosting, you are now ready to install WordPress. Visit our step by step guide on how to make a website, and you’ll be up and ready to go in no time.

Now that you are ready, let’s look at some of the best WordPress themes for bed and breakfasts that you can use on your website.

1. Dreamy

Dreamy

Dreamy is a beautifully designed WordPress theme for bed and breakfasts, spas, resorts and hotels. With a modern and elegant design, Dreamy comes with extensive booking functionality with ready to use templates.

It also includes beautiful sliders, weather widget, highly customizable homepage, and 100+ shortcodes. It is very easy to setup and customize with theme options panel.

2. Milos

Milos

Milos is designed specifically for hotels, bed and breakfasts, and restaurants. It is tested to work beautifully with third-party booking plugins and websites. The homepage features a modern design with a fullscreen slider and a call to action.

It is highly customizable with unlimited color controls, room page templates, social media menus, and more. Inside you will also find a restaurant menu management system to showcase breakfast and dining options available at your bed and breakfast.

3. Parador

Parador

Parador is an elegant WordPress theme for bed and breakfasts, hotels, and similar businesses. It comes with an integrated hotel room booking system that allows visitors to book rooms directly. You get beautiful templates for room pages with photo galleries and sliders.

Inside you will also find testimonials section, social media integration, custom logo support, and unlimited colors. All theme options can be easily configured using theme options panel and customizer.

4. Riverside Resort

Riverside Resort

Riverside Resort is another great WordPress theme for resorts, bed and breakfasts, and hotels. It has a booking form allowing your customers to book rooms or services without leaving your website. It also makes it easy to add room descriptions and photo galleries.

Riverside Resort comes with ready-made templates for spa, meetings, and rooms. You can also use the 1-click installer to import the demo content. It has custom widgets for social media, weather, Google Maps, contact form, and more.

5. Sundance

Sundance

Sundance WordPress theme is another excellent option for a bed and breakfast website. It has custom map, weather, and contact us widgets that you can place at the top. It has a rooms section, which allows you to add available accommodation options with photos.

You can use the built-in functionality to add a blog to your website to engage with your community.

You’ll find it easy to use and setup. It allows you to import demo content and use it as a starting point. All theme options can be easily changed using theme settings and customizer.

6. Haven

Haven

Haven is a highly flexible WordPress theme for bed and breakfasts and hotels. Packed inside are three ready-made demos that you install with 1-click. Each demo website comes with complete content that you can replace with your own to get started. It supports external booking systems like AirBnB, Booking.com, Expedia, and more.

It also has an integrated visual page builder that allows you to create your own page layouts with simple drag and drop. The theme has tons of customization choices with layout styles, colors, header styles, background, and sliders.

7. Paris

Paris

Paris is a sophisticated WordPress theme suitable for hotels, B&B, spas, and travel websites. It comes with plenty of customization options that you’ll expect from a premium theme. It includes a shortcode generator, multiple sidebars, custom widgets, mega menus, and more.

It comes with an easy to use section to add rooms and services. Room templates are beautifully designed with large photo galleries. It is easy to setup with a custom theme options panel which even allows you to add Google Analytics and Google Search Console code to your website.

8. Hotelia

Hotelia

Hotelia is a modern and powerful WordPress theme for hotels with a great set of premium features. It has a fully functional room search feature which allows users to select dates to look for rooms. You can also use Hotelia to build a custom booking website of your own.

It features a modern homepage style that you can setup using theme options panel. It also ships with premium WordPress slider plugin and a drag and drop page builder.

9. HotelEngine Comfy

HotelEngine Comfy

Comfy is a powerful WordPress theme for hotels, B&B, vacation rentals, and similar businesses. It includes a powerful booking engine that allows you to easily manage your property. It is beautifully designed with a slider on top, which is followed by your booking form, rooms, map widget, and more.

It is easy to customize and comes with its own custom theme options panel. Inside you’ll also find multiple sidebars, color schemes, social media integration, and more.

10. SixtyOne

SixtyOne

SixtyOne is another easy to use and super flexible WordPress theme for B&B, resorts, and hotels. It comes with customizable homepage layout allowing to easily display amenities, add slider, and drag and drop widgets.

It also has a fully integrated booking request form with a custom section to add rooms, testimonials, and photo galleries. It has beautiful templates to showcase rooms, room category, contact form page, and more. All theme options can be easily changed using live customizer.

11. Imperial

Imperial

Imperial is a simple WordPress theme designed for bed and breakfast, hostels, and other hospitality businesses. It includes a testimonials section, accomodation template, multiple sidebars, and full-width page template.

Imperial’s main feature is its simplicity and ease of use. The homepage layout features a slider on top followed by rooms and services and a footer widget area. All theme options are available under theme customizer.

12. Courtyard

Courtyard

Courtyard is a free WordPress theme for bed and breakfasts, resorts, and spas. It has a sticky floating navigation menu on top, a fullscreen slider on the homepage, followed by your rooms and services sections.

It is fully customizable using live customizer and works well with popular contact form plugins you want to use for bookings.

13. Palermo

Palermo

If you are looking for classy and elegant WordPress theme for B&B, resort, or hotel, then you’ll like Palermo. This beautifully crafted WordPress theme features a traditional two column layout. The left column remains on screen and it contains your site logo, navigation menus, and social buttons.

It has beautiful templates for your room pages, testimonials, amenities, and photo galleries. Theme customization is super easy with 30 appearance options and style combinations.

14. Ultra

Ultra

Ultra is a powerful multipurpose WordPress business theme designed to work for any kind of business website. It comes with several readymade websites with demo content and 60+ pre-designed layouts. This gives you a good starting point to build your website. It also has an integrated drag and drop builder so you can easily modify the pre-designed layouts or even create your own layouts from scratch.

Despite packing so many features, Ultra is very easy to use and comes an intuitive theme options panel. This allows you to easily setup your website by simply toggling buttons and entering plain text.

15. Indigo

Indigo

Indigo is a beautifully crafted multipurpose WordPress theme for business websites. It has multiple readymade websites with demo content. You can install these websites with 1-click and modify them to meet your needs.

Indigo is easy to use and comes with modules that you can just drag and drop on your pages to add different elements. It is translation ready and comes with full WooCommerce support.

16. Santorini Resort

Santorini

Santorini Resort is a uniquely designed WordPress theme for resorts, hotels, and bed and breakfasts. It includes sections to easily add rooms, gallery, videos, services, and attractions. It has a flexible homepage with widget areas, which allows you to just drag and drop content widgets to set it up.

The theme also comes with a booking request form. You can also use any WordPress form builder plugin to create your own forms as well.

17. Lighthouse

Lighthouse

Lighthouse is a colorful and free WordPress theme suitable for travel, hotels, B&B websites. It features an elegant landing page with a fullwidth header image. It has multiple widget ready areas, two navigation menus, and color customization features.

It also has beautiful templates for galleries, blog posts, and full-width pages. All theme options are conveniently located under theme customizer.

18. Olympus Inn

Olympus Inn

Olympus is another modern WordPress B&B theme. Its homepage features a beautiful large slider with a booking form overlay and call to action button. It has a very modern and look to it that makes your website standout.

It is packed with customization options and has sections to easily add rooms, attractions, image galleries, and testimonials. The homepage layout is easy to setup with a drag and drop layout builder.

19. Cortina

Cortina

Designed specifically for B&B and hotels, Cortina is a modern WordPress theme. It has an integrated booking form on all room pages. It comes with unlimited color schemes, sidebars, and page layouts allowing you to customize the look and appearance of the theme to match your brand.

It has beautiful templates for galleries, fullwidth page, toggle, accordion FAQs, and tabs. Theme setup is quite simple and you’ll be able to get up and running in no time.

20. Narcos

Narcos

Narcos is a versatile WordPress multipurpose theme for businesses. It has a modern homepage layout which makes it perfect for B&B website. It has built-in sections for testimonials, portfolio, services, and staff profiles.

The homepage has a fullscreen slider, parallax background effect, CSS3 animations, and a modular layout. Theme setup is quite easy and you’ll have plenty of options to change anything you like. It can also be used to add an online store to your website.

21. Aegean Resort

Aegean Resort

Need bright colors and spacious layout for your bed and breakfast website? Check out Aegean. This beautifully designed simple WordPress theme is a mix of minimalism and functionality. It includes a booking form, weather widget, location, and beautiful templates for rooms.

It is quite simple to use as well. The homepage layout is easy to setup by just adding content widgets to the theme. It has multiple custom widgets for content and social media integration.

22. Presence

Presence

Presence is a WordPress business theme with a built-in demo for hotel website. This hotel demo comes with a booking form, room templates, attractions section, and Google Maps support.

It is packed with features like multiple layout choices, sidebars, header styles, 6 color schemes, and more. It is ready for WooCommerce and can be used on multilingual websites using WPML.

23. Zermatt

Zermatt

Zermatt is a stunningly beautiful WordPress theme for hotels and bed and breakfasts. It has beautiful transparent navigation menu with a weather widget on top. The homepage setup is made up of different widget ready areas. Zermatt includes several custom widgets, which you can just drag and drop to setup homepage.

It also has beautiful sliders, photo galleries, page templates, and of course a booking form. You’ll like its ease of use and professional appearance.

24. Marea

Marea

Marea is designed for holiday homes, vacation rentals, B&Bs, and similar businesses. Featuring a modern layout, this WordPress theme is packed with all the features you’ll need to quickly setup your website. It has unlimited color choices and Google Fonts support.

You can get started with 1-click demo content installer and then replace content with your own. Choose your own branding to customize the theme and you’ll be all set.

We hope this article helped you find the best WordPress theme for bed and breakfasts. You may also want to see our list of essential WordPress plugins for business websites.

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 24 Best WordPress Themes for Bed and Breakfasts appeared first on WPBeginner.

How to Create a Video Portfolio in WordPress

Do you want to create a video portfolio in WordPress? By default, you can easily embed a videos in WordPress, but you cannot display multiple videos in a portfolio style layout. In this article, we will show you how to easily create a video portfolio… Read More »

The post How to Create a Video Portfolio in WordPress appeared first on WPBeginner.

Do you want to create a video portfolio in WordPress? By default, you can easily embed a videos in WordPress, but you cannot display multiple videos in a portfolio style layout. In this article, we will show you how to easily create a video portfolio in WordPress without slowing down your website or writing code.

Creating a video portfolio in WordPress

Getting Started with Your Video Portfolio

The first thing you need to do is start a WordPress blog or a website. If you already have a website, then you can move to the next step.

WordPress allows you to easily embed videos in your blog posts and pages. However, it does not allow you to easily create a beautiful video portfolio out of the box.

For your video portfolio, you’ll want to display your videos in a nice grid based layout, so that more videos can be viewed without a lot of scrolling. You also need to make sure that it works on mobile devices and offers good user experience.

While you can upload a video to your WordPress site, we recommend using a third-party service like YouTube or Vimeo because videos are resource intensive, and they can slow down your site. See our article on why you should never upload videos to WordPress.

That being said, now let’s see how to easily create a video portfolio in WordPress. The goal is to create a portfolio section that not only looks great, but also works on all devices and screen sizes without any issues.

Creating a Video Portfolio in WordPress

First thing you need to do is install and activate the Envira Gallery plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Envira Gallery is a paid WordPress photo gallery plugin, and you’ll need at least Pro plan to access videos addon.

WPBeginner users can use this Envira Gallery coupon to get 25% off.

Upon activation, you need to visit Envira Gallery » Settings page to add your license key. You can find this information from your account on Envira Gallery website.

Enter your Envira Gallery license key

Next, you need to head over to Envira Gallery » Addons page. You’ll see all the addons available for you to install. Look for the Videos addon and install it.

Install videos addon

Envira Gallery will now fetch and install the videos addon. After that, you need to click ‘Activate’ to start using it on your website.

Activate video addon

Now you are ready to create your first video portfolio gallery.

Head on over to the Envira Gallery » Add New page to create your first gallery. First, you need to provide a title for your gallery.

New Gallery

Envira Gallery can create a gallery of your self-hosted videos as well as videos hosted on platforms like YouTube, Wistia, and Vimeo. We recommend using third-party video hosting services like YouTube or Vimeo to avoid performance issues with your WordPress hosting provider.

After uploading your videos to YouTube or Vimeo, you need to click on ‘Select files from other sources’ button.

This will bring up the Insert Media popup where you need to click on the ‘Insert videos’ link in the left column.

Add videos to your gallery

You need to click on the Add Video button and enter the title of your video as well as paste the video URL.

You can also add more videos by clicking on the Add Video button again and repeat the process until you have added all the videos you wanted to show in your portfolio.

Once finished, click on the ‘Insert into Gallery’ button to continue.

Envira Will now show thumbnails it fetched from your videos in the Images section.

Video thumbnails

You can edit, hide, or add more items to the gallery at anytime.

Now let’s configure the video gallery a bit.

You need to click on the ‘Config’ tab and under ‘Number of Gallery Columns’ options select two or three column layout. This ensures that your video thumbnails appear nicely with adequate space between each video.

Select number of columns

Next, switch to the ‘Videos’ tab and check the box next to ‘Display play icon over gallery image’ option.

Show play button over videos

Now you can click on the publish button to make your video portfolio gallery available to WordPress.

Displaying Your Video Portfolio Gallery in WordPress

Envira Gallery makes it easy for you to add video or photo galleries anywhere on your WordPress site.

You can add it in posts, pages, as well as widget areas. For the sake of this example, we’ll go ahead and add it on a new page.

Go ahead and create a new page in WordPress and give it an appropriate title, for example: Portfolio.

On the page edit screen, you need to click on the Add Gallery button.

Add your video portfolio gallery

This will bring up a popup where you’ll see your video portfolio gallery. Click to select it and then click on the Insert button.

Insert your video gallery

Envira Gallery shortcode will now appear in your post editor.

You can now update or publish your page and visit the page to see your portfolio gallery in action.

Video portfolio preview

Clicking on each video will open it in a lightbox popup. Your users will be able to view the video without leaving your website. They will also be able to browse other videos by clicking on the thumbnails below the player.

Video lightbox popup

We hope this article helped you learn how to create video portfolio in WordPress. You may also want to see our beginners guide on how to boost WordPress speed and performance.

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 How to Create a Video Portfolio in WordPress appeared first on WPBeginner.

5 Best WordPress Landing Page Plugins Compared (2017)

Looking for an easy way build landing pages in WordPress? You need a landing page plugin that allows you to quickly create landing pages by using simple drag and drop tools without writing any code. In this article, we will review top 5 of the… Read More »

The post 5 Best WordPress Landing Page Plugins Compared (2017) appeared first on WPBeginner.

Looking for an easy way build landing pages in WordPress? You need a landing page plugin that allows you to quickly create landing pages by using simple drag and drop tools without writing any code. In this article, we will review top 5 of the best WordPress landing page plugins and compare them against each other.

Best WordPress landing page plugins

Why Use a Landing Page Plugin for WordPress?

If you created your website to sell a book, service, or another product, then you need to make a landing page.

Landing pages help you improve your conversions and convert more visitors into customers.

We know that most business owners and WordPress beginners are not tech savvy and cannot write code. That’s where a WordPress landing page plugin comes in.

These plugins come with several ready to use templates with drag and drop tools to edit them or create your own landing pages from scratch.

This gives you freedom to quickly build landing pages for your marketing campaigns without hiring a developer. You can reuse your templates, create new ones, and build your own library of ready to deploy landing page designs.

That being said, let’s take a look at the best WordPress landing page plugins, and how they stack up against each other.

Our criteria for this comparison is: ease of use, flexibility, and design possibilities.

All plugins mentioned in this list are mobile responsive.

1. Beaver Builder

Beaver Builder

Beaver Builder is a popular WordPress landing page plugin. It comes with dozens of ready-made templates that you can use as starting point for your landing pages.

Editing landing pages is a breeze with Beaver Builder’s blazing fast drag and drop builder. Simply point and click on any element in a page to edit its properties. You can also move them up and down, or add new modules to your page. You can see more details in our article on creating custom WordPress layouts with Beaver Builder

Beaver Builder is designed to work with any WordPress theme. You can switch themes without worrying about your landing pages.

If at any point you decide to stop using it, then your content will be neatly ported to the default WordPress editor.

By far, it is the most beginner-friendly and easy to use WordPress landing page plugin on the market. Despite its ease of use, it is still powerful enough to create landing pages for any kind of website.

Grade: A+

Pricing: Starting from $99 for unlimited websites and 1 year of support.

Review: We found Beaver Builder to be the most easy to use landing page plugin for WordPress. The builder interface is intuitive and fast. The ability to edit anything with point and click works really well. With dozens of readymade templates, Beaver Builder is certainly the best WordPress landing page plugin.

2. Elementor

Elementor

Elementor is another easy to use WordPress landing page builder. It is super fast and comes with several ready-made templates for different scenarios including landing pages.

It has a blazing fast UI with live editor. Page area can be arranged into sections and columns. You can add modules to your columns like buttons, images, headings, sliders, and more. You can also use WordPress widgets and widgets added by other WordPress plugins installed on your website.

Want to build a page from scratch? You can start with Elementor’s canvas template which offers a blank slate to create your own pages with unique design and layout. See it in action in our guide on how to create custom wordpress layouts with Elementor.

Grade: A

Pricing: Starting from $49 for single site with 1 year of support and updates.

Review: Elementor is easy to use and learn, which makes it a great landing page plugin. It has professionally designed templates and several modules, which offer even more flexibility to create your own pages.

3. Divi

Divi

Divi is a popular option for building landing pages in WordPress. It is created by Elegant Themes, one of the oldest WordPress theme shops in the market. If you are using one of their themes, then you probably already have access to Divi.

It comes with 20+ ready to use templates. You can also create your own templates and reuse them later. Divi comes with beautiful point and click page editor and a ton of drag and drop elements. It is super easy to use and work with.

Divi is available as a theme with integrated builder, so you can use it to make a custom blog design. It is also available as a standalone builder that works with any other WordPress theme.

Grade: A

Pricing: Starting from $89 per year for unlimited websites

Review: Divi offers a good user experience with a very easy to use and intuitive landing page editor. There’s a strong community around Divi that’s fast growing, and the ElegantThemes team is constantly coming up with new features.

4. OptimizePress

OptimizePress

OptimizePress is a powerful WordPress landing and sales page plugin. It comes as a theme as well as a plugin allowing you to use it with any other WordPress theme.

There are 30+ ready to use templates. Each one of them is designed to be a high converting sales page.

It comes with a design tool to edit landing page templates. The part that stands about OptimizePress is that it seamlessly connects with several email marketing services and WordPress membership plugins.

This makes OptimizePress a very comprehensive solution for landing pages.

Grade: B+

Pricing: Starting from $97 for 3 websites with 1 year of support and updates.

Review: OptimizePress is a comprehensive solution with a lot of features. However, when it comes to editing, it is not as intuitive as some other plugins in this list.

5. Coming Soon Pro by SeedProd

Coming Soon Pro by SeedProd

Coming Soon Pro by SeedProd is another great option to quickly build beautiful coming soon pages that are optimized for conversions.

It has several beautifully designed templates that you can easily tweak and setup. It works with all top email marketing services and has built-in social media integration in all templates.

Unlike other plugins on the list, Coming Soon Pro is limited to creating coming soon, maintenance pages, and product launch placeholders. For details, see our guide on creating beautiful coming soon pages in WordPress with SeedProd.

Grade: B

Pricing: Starting from $29 for 1 site with no addons. $79 for all addons included.

Review: Coming Soon Pro is a great tool to quickly build coming soon or product launch landing pages. However, it is not ideal to build landing pages for sale and post-launch marketing.

Conclusion

Looking at the top WordPress landing page plugins, it became quite clear to us that Beaver Builder is the best landing page plugin in the market.

It has beautiful landing page templates. The page editor is intuitive, fast, and easy to use. The best part is that it works with any WordPress theme and is compatible with all essential WordPress plugins.

We hope this comparison helped you find the best WordPress landing page plugins. You may also want to see our comparison of best WordPress contact form plugins and WordPress backup plugins.

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 5 Best WordPress Landing Page Plugins Compared (2017) appeared first on WPBeginner.

How to Turn Your WordPress Site Into a Social Network

Did you know that you can turn your WordPress site into a social network? A WordPress social network allows users to sign up, connect with each other, post messages, and more. In this article, we will show you how to turn your WordPress site into… Read More »

The post How to Turn Your WordPress Site Into a Social Network appeared first on WPBeginner.

Did you know that you can turn your WordPress site into a social network? A WordPress social network allows users to sign up, connect with each other, post messages, and more. In this article, we will show you how to turn your WordPress site into a social network.

Create a Social Network with BuddyPress

Starting your WordPress Powered Social Network

WordPress is the most easy to use platform to build your own social network using the free BuddyPress plugin. It is super flexible and integrates beautifully with any kind of WordPress website.

You’ll need a self-hosted WordPress.org website to start using BuddyPress.

If you don’t have a website yet, then follow the instructions in our how to make a website guide, and you’ll be up and running in no time.

What is BuddyPress?

BuddyPress is a sister project of WordPress.org. It is available as a free WordPress plugin that you can install on your website.

It turns your WordPress site into a social network allowing you to build your own online community. Here are some of the features of a typical BuddyPress powered website:

  • Users can register on your website
  • Users will be able to create extended user profiles
  • Activity streams allow users to follow site-wide updates
  • You will be able to create sub-communities with user groups
  • Users can add each other as friends
  • Users can send private messages to each other
  • BuddyPress functionality can be extended using third-party plugins
  • Works with any standard compliant WordPress theme
  • Can be setup with your existing WordPress site

Setting up Your WordPress Social Network Using BuddyPress

First thing you need to do is install and activate the BuddyPress plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation you need to visit Settings » BuddyPress page to configure plugin settings.

BuddyPress Settings

The settings page is divided into different sections. You’ll first see the components page which shows you currently active BuddyPress components on your site.

The default components would work for most websites. However, you can activate or deactivate a component by simply checking and unchecking the box next to it.

Don’t forget to click on the save settings button to store your changes.

Next, you need to click on the Pages tab. Here you can select the pages you would like to use for different BuddyPress sections on your site.

By default, the plugin will automatically create pages for you. You can change them and use a different page if you want.

Setting up pages

If you don’t see the option to select registration and activation pages, then you need to enable user registration on your WordPress site.

Now, you will need to switch to the ‘Options’ tab.

BuddyPress options

Here you will find different settings that you can turn on/off in BuddyPress. The default settings will work for most websites, but you can review and change them as needed.

Displaying BuddyPress Pages on Your Website

If you visit your website after setting up BuddyPress, you’ll not see anything new added to your site. To change this, you need to add BuddyPress pages to your WordPress navigation menu.

Head over to Appearance » Menus page. Select the BuddyPress pages from the left column and click on add to menu button.

BuddyPress navigation

Don’t forget to click on the save menu button to store your changes.

You can now visit your website to see the links in action.

BuddyPress links

Clicking on a link will take you to a BuddyPress page. For example, the activity link will show you what’s going around in your BuddyPress social network. You can also post a status update from this page.

Activity page

BuddyPress works with all standard compliant WordPress themes. It also comes with its own templates to use in case your theme doesn’t have BuddyPress specific templates.

If your theme isn’t compatible with BuddyPress, then checkout our list of the best WordPress themes for BuddyPress.

Managing Your WordPress Social Network in BuddyPress

Building an online community requires a lot of active participation by the site admins. You would want to combat spam and moderate user generated content.

If you are already using Akismet, then BuddyPress will use it to catch spam. However, some unwanted content may still slip away.

BuddyPress comes with built-in tools to deal with that.

Head over to the Activity page in your WordPress admin area, and you will see recent activity on your website with different actions.

Managing user activity in BuddyPress

You can sort the activity items by action, delete items, or mark them as spam.

Similarly, you can go to Users page to manage user accounts. You can delete users, edit their profiles, or mark suspicious accounts as spam.

Managing user accounts

You can manage new users by visiting the manage signups page. This allows you to directly activate new users, resend them activation email, or delete spam accounts.

Manage new signups

Creating and Managing Groups in BuddyPress

BuddyPress allows you and your users to create groups. These groups act as sub-communities on your website. Each group can have it’s own members and activity streams. Users can join these groups, invite other users, post messages, and more.

To create a new group, you can head over to the Groups page and click on the add new button at the top.

Add new group

This will bring you to the add new group page. First you need to provide a name and description for your group. After that, click on the ‘Create group and continue’ button to proceed.

Creating a new group in BuddyPress

On the next page, you can select group’s privacy settings and who can invite other users to the group. BuddyPress allows you to create public, private, and hidden groups.

Group privacy settings

Public groups are available for all users to join.

Private groups are listed in the groups directory, but users will have to request to join. If approved, then then they will be able to view its contents.

Hidden groups can only be seen by members who are part of the group. These groups are not listed in the groups directory, and they do not appear in search results.

After setting up privacy options, click on the next button to continue.

Now you can provide a photo to be used as group’s profile photo.

Profile photo for the group

Next, you need to add a cover photo for the group and click on the next button.

Lastly, you can invite other users to join the group. You can only invite users you’ve added as friends. If you haven’t added any friends yet, then you will have to wait for users to discover the group and join it on their own.

Invite users to join group

Click on the finish button and BuddyPress will now setup your group.

Users can view groups by visiting the groups page on your site which shows the directory of groups on your website.

Groups directory

Clicking on a group name will show the group’s page where users can join a group, post updates, and follow group activity.

Group page

Managing Email Notifications

Email notifications are the only way your BuddyPress site can alert users about new activity in their social stream. To encourage user participation, you may want to customize those email messages.

BuddyPress allows you to modify email notifications sent by your WordPress social network. This helps you change the messages to match your site’s branding and tone.

You can visit the Emails page to see the list of default email notifications. You will see the email title, and the situation when the email is sent to a user.

Edit email notifications in BuddyPress

You can click on the Add New button at the top to create a new email notification. You can also click on the edit button below an email message to change it.

Editing email notifications

Lastly, you can also use the email customizer to modify the email colors, header, and footer areas.

Customize emails

Troubleshooting BuddyPress

Many of the issues you’ll come across with BuddyPress will be similar to WordPress issues. Make sure you check our list of common WordPress errors to see if it’s listed there.

If your users are unable to receive email notifications, then follow the instructions in our guide on how to fix WordPress not sending email issue.

For all other issues, check out our WordPress troubleshooting guide to understand what’s causing it, and how to find a solution.

That’s all for now.

We hope this article helped you turn your WordPress site into a social network using BuddyPress. You may also want to see our ultimate step by step WordPress security guide for beginners.

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 How to Turn Your WordPress Site Into a Social Network appeared first on WPBeginner.

How to Turn Your WordPress Site Into a Social Network

Did you know that you can turn your WordPress site into a social network? A WordPress social network allows users to sign up, connect with each other, post messages, and more. In this article, we will show you how to turn your WordPress site into… Read More »

The post How to Turn Your WordPress Site Into a Social Network appeared first on WPBeginner.

Did you know that you can turn your WordPress site into a social network? A WordPress social network allows users to sign up, connect with each other, post messages, and more. In this article, we will show you how to turn your WordPress site into a social network.

Create a Social Network with BuddyPress

Starting your WordPress Powered Social Network

WordPress is the most easy to use platform to build your own social network using the free BuddyPress plugin. It is super flexible and integrates beautifully with any kind of WordPress website.

You’ll need a self-hosted WordPress.org website to start using BuddyPress.

If you don’t have a website yet, then follow the instructions in our how to make a website guide, and you’ll be up and running in no time.

What is BuddyPress?

BuddyPress is a sister project of WordPress.org. It is available as a free WordPress plugin that you can install on your website.

It turns your WordPress site into a social network allowing you to build your own online community. Here are some of the features of a typical BuddyPress powered website:

  • Users can register on your website
  • Users will be able to create extended user profiles
  • Activity streams allow users to follow site-wide updates
  • You will be able to create sub-communities with user groups
  • Users can add each other as friends
  • Users can send private messages to each other
  • BuddyPress functionality can be extended using third-party plugins
  • Works with any standard compliant WordPress theme
  • Can be setup with your existing WordPress site

Setting up Your WordPress Social Network Using BuddyPress

First thing you need to do is install and activate the BuddyPress plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation you need to visit Settings » BuddyPress page to configure plugin settings.

BuddyPress Settings

The settings page is divided into different sections. You’ll first see the components page which shows you currently active BuddyPress components on your site.

The default components would work for most websites. However, you can activate or deactivate a component by simply checking and unchecking the box next to it.

Don’t forget to click on the save settings button to store your changes.

Next, you need to click on the Pages tab. Here you can select the pages you would like to use for different BuddyPress sections on your site.

By default, the plugin will automatically create pages for you. You can change them and use a different page if you want.

Setting up pages

If you don’t see the option to select registration and activation pages, then you need to enable user registration on your WordPress site.

Now, you will need to switch to the ‘Options’ tab.

BuddyPress options

Here you will find different settings that you can turn on/off in BuddyPress. The default settings will work for most websites, but you can review and change them as needed.

Displaying BuddyPress Pages on Your Website

If you visit your website after setting up BuddyPress, you’ll not see anything new added to your site. To change this, you need to add BuddyPress pages to your WordPress navigation menu.

Head over to Appearance » Menus page. Select the BuddyPress pages from the left column and click on add to menu button.

BuddyPress navigation

Don’t forget to click on the save menu button to store your changes.

You can now visit your website to see the links in action.

BuddyPress links

Clicking on a link will take you to a BuddyPress page. For example, the activity link will show you what’s going around in your BuddyPress social network. You can also post a status update from this page.

Activity page

BuddyPress works with all standard compliant WordPress themes. It also comes with its own templates to use in case your theme doesn’t have BuddyPress specific templates.

If your theme isn’t compatible with BuddyPress, then checkout our list of the best WordPress themes for BuddyPress.

Managing Your WordPress Social Network in BuddyPress

Building an online community requires a lot of active participation by the site admins. You would want to combat spam and moderate user generated content.

If you are already using Akismet, then BuddyPress will use it to catch spam. However, some unwanted content may still slip away.

BuddyPress comes with built-in tools to deal with that.

Head over to the Activity page in your WordPress admin area, and you will see recent activity on your website with different actions.

Managing user activity in BuddyPress

You can sort the activity items by action, delete items, or mark them as spam.

Similarly, you can go to Users page to manage user accounts. You can delete users, edit their profiles, or mark suspicious accounts as spam.

Managing user accounts

You can manage new users by visiting the manage signups page. This allows you to directly activate new users, resend them activation email, or delete spam accounts.

Manage new signups

Creating and Managing Groups in BuddyPress

BuddyPress allows you and your users to create groups. These groups act as sub-communities on your website. Each group can have it’s own members and activity streams. Users can join these groups, invite other users, post messages, and more.

To create a new group, you can head over to the Groups page and click on the add new button at the top.

Add new group

This will bring you to the add new group page. First you need to provide a name and description for your group. After that, click on the ‘Create group and continue’ button to proceed.

Creating a new group in BuddyPress

On the next page, you can select group’s privacy settings and who can invite other users to the group. BuddyPress allows you to create public, private, and hidden groups.

Group privacy settings

Public groups are available for all users to join.

Private groups are listed in the groups directory, but users will have to request to join. If approved, then then they will be able to view its contents.

Hidden groups can only be seen by members who are part of the group. These groups are not listed in the groups directory, and they do not appear in search results.

After setting up privacy options, click on the next button to continue.

Now you can provide a photo to be used as group’s profile photo.

Profile photo for the group

Next, you need to add a cover photo for the group and click on the next button.

Lastly, you can invite other users to join the group. You can only invite users you’ve added as friends. If you haven’t added any friends yet, then you will have to wait for users to discover the group and join it on their own.

Invite users to join group

Click on the finish button and BuddyPress will now setup your group.

Users can view groups by visiting the groups page on your site which shows the directory of groups on your website.

Groups directory

Clicking on a group name will show the group’s page where users can join a group, post updates, and follow group activity.

Group page

Managing Email Notifications

Email notifications are the only way your BuddyPress site can alert users about new activity in their social stream. To encourage user participation, you may want to customize those email messages.

BuddyPress allows you to modify email notifications sent by your WordPress social network. This helps you change the messages to match your site’s branding and tone.

You can visit the Emails page to see the list of default email notifications. You will see the email title, and the situation when the email is sent to a user.

Edit email notifications in BuddyPress

You can click on the Add New button at the top to create a new email notification. You can also click on the edit button below an email message to change it.

Editing email notifications

Lastly, you can also use the email customizer to modify the email colors, header, and footer areas.

Customize emails

Troubleshooting BuddyPress

Many of the issues you’ll come across with BuddyPress will be similar to WordPress issues. Make sure you check our list of common WordPress errors to see if it’s listed there.

If your users are unable to receive email notifications, then follow the instructions in our guide on how to fix WordPress not sending email issue.

For all other issues, check out our WordPress troubleshooting guide to understand what’s causing it, and how to find a solution.

That’s all for now.

We hope this article helped you turn your WordPress site into a social network using BuddyPress. You may also want to see our ultimate step by step WordPress security guide for beginners.

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 How to Turn Your WordPress Site Into a Social Network appeared first on WPBeginner.

How to Manually Update WordPress Plugins via FTP

Do you want to learn how to manually update WordPress plugins via FTP? Sometimes the 1-click WordPress plugin update fails which can break your website. The only way to fix that is by manually updating the plugin. In this article, we will show you how… Read More »

The post How to Manually Update WordPress Plugins via FTP appeared first on WPBeginner.

Do you want to learn how to manually update WordPress plugins via FTP? Sometimes the 1-click WordPress plugin update fails which can break your website. The only way to fix that is by manually updating the plugin. In this article, we will show you how to manually update WordPress plugins via FTP without breaking your website.

Manually updating WordPress plugins via FTP

Why Update WordPress Plugins Manually?

WordPress comes with a built-in system to manage core, theme, and plugin updates. All you need to do is click on the update link, and it will update your plugins. For more details, see our guide on how to properly update WordPress plugins.

However sometimes these updates can fail due to incorrect file permissions, incorrect version number, or other server configuration factors.

If an update gets interrupted midway, then you will end up with a broken site. You may see briefly unavailable for scheduled maintenance error, syntax error, or internal server error.

The only way to fix this is by manually updating the WordPress plugin via FTP. By doing so, you will be able to fix those errors and continue using the latest version of the plugin.

Let’s take a look at how to manually update WordPress plugins via FTP.

Manually Updating WordPress Plugins via FTP

First, you will need to download the latest version of the plugin you are trying to update. If it is a free plugin, then you can download it from the WordPress.org plugin page.

downloading a free WordPress plugin

If it is a premium plugin, then you can download the latest version from the specific plugin’s website. You will need to login to your account and download the plugin to your computer.

All plugins come in .zip files, so you need to extract them.

Unzip plugin file

Next, you’ll need an FTP client. We’ll be using FileZilla in our example, but you can use any FTP client you like.

To connect to your website using FTP, you will need to enter your website name in the hostname with your FTP username and password.

Connecting FTP client to your website

If you don’t know your FTP username or password, then check the email your WordPress hosting company sent you when you signed up. It usually contains your FTP username and password.

Alternatively, you can also find this information in the cPanel dashboard of your hosting account.

Once you are connected to your website via FTP, you need to go to /wp-content/plugins/ folder.

You’ll see different folders for all the plugins you have installed on your WordPress site. Right click on the plugin that you want to update and then select ‘Rename’.

Rename old plugin folder

Now rename this plugin by simply adding -old to the plugin folder name. For example, wpforms-old.

Next, you need to download the renamed folder to your computer as a backup. This will allow you to revert back to the old version in case you need it.

Backup old version of plugin

After downloading the old plugin to your computer, you can delete it from your website.

Delete old version of plugin from your website

We also want to make sure that the plugin is deactivated in WordPress database as well. To do that, you need to simply login to your WordPress admin area and visit the plugins page.

You will see an error that the plugin has been deactivated due to an error.

Deactivated

Now that we have removed the old version, it is time to install the latest version of the plugin.

Switch to your FTP client and under the ‘Local’ section, locate the new plugin folder on your computer. Now right click and select ‘Upload’ from FTP menu.

Upload new version of the plugin

Your FTP client will start transferring the plugin folder from your computer to your website.

Once finished, you can login to your WordPress admin area and go to the Plugins page. You need to find the newly installed plugin and activate it.

Activate the latest version of plugin

You can now check the updated version of the plugin to make sure that everything is working correctly.

That’s all, you have successfully updated a WordPress plugin via FTP.

It is really crucial for WordPress security to always use the latest version of WordPress. It is also equally important to keep your WordPress plugins and theme updated.

If a WordPress plugin stops working after the update, then you can rollback the plugin and report the issue to the plugin developer.

However, there is no reason to continue using an outdated version. If the issue is not resolved in a timely manner, then you should look for an alternative plugin to do the job.

We hope this article helped you learn how to manually update WordPress plugins via FTP. You may also want to see our list of most common WordPress errors and how to fix them.

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 How to Manually Update WordPress Plugins via FTP appeared first on WPBeginner.

24 Best WordPress Themes for Bars and Pubs

Are you looking for the best WordPress themes for bars? A WordPress theme that matches your bar’s real experience and ambiance can bring in more customers and help you grow your business. In this article, we have hand-picked some of the best WordPress themes for… Read More »

The post 24 Best WordPress Themes for Bars and Pubs appeared first on WPBeginner.

Are you looking for the best WordPress themes for bars? A WordPress theme that matches your bar’s real experience and ambiance can bring in more customers and help you grow your business. In this article, we have hand-picked some of the best WordPress themes for bars and pubs that will make your website stand out.

Best WordPress themes for bars and pubs

Using WordPress To Build a Bar Website

WordPress is used by thousands of restaurants, bars, cafes, and pubs all over the world. Mainly because it is easy to use and customize.

To get started, first you need to make sure that you are using the right platform for your website. We recommend using WordPress.org instead of WordPress.com. See our comparison: WordPress.com vs WordPress.org for more details.

Next, you will need to signup for a WordPress hosting account. All websites need web hosting. This is where your files are stored on the internet.

We recommend using Bluehost. They are one of the largest hosting companies and an officially recommended WordPress hosting provider.

After getting hosting, you are now ready to install WordPress. Follow the instructions in our how to make a website guide, and you will be up and running in no time.

Having said that, let’s take a look at some of the best WordPress themes for bars, pubs, and cafes.

Note: This list contains both free and paid themes and all of them are mobile responsive.

1. Creativo

Creativo

Creativo is a flexible multi-purpose WordPress theme for all kind of websites. It includes 10 ready-made website layouts that can be installed with one-click. These ready-made websites also include a complete website for bars and cafes.

It has full WooCommerce support, 7 skins, 3 design layouts, multiple header layouts, and unlimited color choices. Theme setup is simplified with a powerful custom theme options panel. It also ships with premium tools like a drag and drop page builder, slider, and a live chat plugin.

2. Event

Event

Event is a beautifully designed WordPress theme for bars, events, nightclubs, and lifestyle websites. As the name suggests, it comes with a built-in events section, so you can easily feature events on your website. It also includes a section to embed videos and upload photos.

Event theme is shipped with an integrated page builder, so you can just drag and drop items to create your own layouts. It also includes beautiful parallax effects, social sharing, ad display, WooCommerce, and WPML support for multilingual websites.

3. Optimus

Optimus

Optimus is another great multipurpose WordPress theme suitable for bars and pubs. It includes 15 unique demos for different kind of websites. You can use one as a starting point for your website.

It has several page layouts, header styles, custom widgets, mega menu, and tons of other customization options. It has a custom theme options panel which makes it easy to setup your website. Other notable features include icon fonts, unlimited colors, Google fonts, premium slider plugin and a page builder.

4. Sessions

Sessions

If your bar showcases live music events, then you’ll love Sessions. It is a WordPress theme for music events, bars, lifestyle, and entertainment websites. It includes custom post types for artists, discography, events, photo galleries and videos.

The homepage layout is fully widgetized with several content widgets that you can just drag and drop. It comes with full WooCommerce support and it is fully compatible with all popular page builder plugins.

5. Jedkey

Jedkey

JedKey is a very stylish and modern looking WordPress theme suitable for bars, pubs, photography, fashion, entertainment websites. It includes pre-configured page layouts for portfolio, shop, full-width page, services, and contact page.

It is fully customizable with unlimited colors, fullscreen background, CSS animations, and easy theme setup process.

6. Berliner

Berliner

Berliner is a sophisticated WordPress theme for events, bars, and musicians. It comes with sections to easily add events, artists, discography, galleries and videos. It allows you to beautifully showcase your bar events on your website to bring in more customers.

It has a widgetized homepage layout, which allows you to drag and drop content widgets to setup your homepage. It also has custom widgets for social networking, Twitter, Flickr and more.

7. Highend

Highend

Highend is a beautifully designed WordPress theme suitable for all kind of businesses including bars, pubs, cafes, and more. It comes with 16+ readymade websites that you can install with 1-click. This gives you a great starting point to create a very professional looking blog or website.

Inside you will find tons of customization options with multiple header styles, page layouts, custom widgets, and a powerful theme options panel. It is eCommerce ready and can be used to start an online store. You will also get freebies like premium page builder and slider plugins.

8. Downtown

Downtown

Downtown is a clean and modern WordPress theme suitable for restaurants, cafes, bars, and pubs. It has a custom Google Maps feature to indicate your bar’s location, a menu section, recipes, and contact form.

It features beautiful parallax background effects and elegant transitions on the homepage. It uses shortcodes to easily add special offers, buttons, pricing tables, tabs, team members and more. Theme setup is quite simple with its own theme options panel.

9. The Core

The Core

The Core is a mega WordPress theme with 20 ready-made websites packed in one theme. This includes 3 templates for restaurant, bars, and food related websites. All these websites are fully customizable with complete demo content that you can replace with your own content.

It comes with a built-in visual page builder and a powerful theme dashboard. Also included are multiple page layouts, custom headers, backgrounds, sliders, custom widgets, and built-in social media features.

10. Delicio

Delicio

Designed for restaurants, bars, and cafes, Delicio is a flexible WordPress theme with clean modern layout. It comes with a food menu page, custom colors, backgrounds, fonts, and headers.

It also has a drag and drop page builder and full WooCommerce support. For navigation it has a sticky floating menu at the top and a sliding sidebar panel. Theme setup is quite straightforward with a custom settings page. It is translation ready and can be used to build multilingual websites.

11. Locales

Locales

Want to build a directory of local bars in your town? Check out Locales. It is a WordPress business directory theme which allows you to easily add places to your website and display them beautifully.

It also comes with a form to accept user submitted listings, allowing you to make money from your business directory. It has beautiful listing pages with integrated Google Maps to display locations along side. Each page also has built in social sharing features.

12. Paperback

Paperback

Paperback is a multipurpose WordPress theme that can easily used for bars, pubs, and nightclubs. If your bar website has a lot of content or a blog, then you’ll love Paperback’s readability and layout.

The homepage has a beautiful featured content carousel and category mega menu on top. This allows you to showcase more content on your homepage. It has gorgeous typography and beautiful photo gallery templates. It is easy to setup by using theme customizer.

13. Croccante

Croccante

Croccante is a free multipurpose WordPress theme with a unique modern design suitable for bars. It is a one page theme with a vertical navigation feature. The homepage features a large fullscreen header with a prominent welcome message.

It has a beautiful fullscreen search overlay, live theme customizer support, unlimited colors, 2 sidebars, custom logo, social media buttons, and more.

14. Suarez

Suarez

Suarez is a well-crafted WordPress theme with a unique creative look. It has a featured slider on top, followed by an about us section, and then your other content. It also has a newsletter signup form, custom Instagram widget, ad spots, and unlimited colors.

It has page templates for your about us and contact pages. Theme setup is quite easy and it also comes with theme options panel to make it even easier. With so many customization options, you can use it to make a beautiful website for your bar or pub.

15. Lenscap

Lenscap

Lenscap is a thoughtfully designed WordPress theme for all kind of websites. It features a magazine style layout on the homepage, which allows you to showcase your bar along with content from your blog, photo galleries, videos, and more.

It has beautiful templates for individual pages and posts, immersive lightbox popup for videos and galleries, and full WooCommerce support. It has a simplified theme setup with only the options you actually need.

Lenscap comes pre-equipped with WPForms, the best WordPress contact form plugin, so you can easily create a contact form.

16. Igloo

Igloo

Igloo is a modern and clean WordPress restaurant theme which is also suitable for bars, cafes, and similar businesses. It is a highly customizable theme with a full-width slider on top, followed by your other pages.

It has menu pages, sliders, photo galleries, and testimonials sections. The homepage layout is widgetized, you’ll just need to add your content widgets to set it up. Igloo includes unlimited color schemes, social networking widgets, 2 navigation menus, and support for all essential WordPress plugins for business websites.

17. Sarmys

Sarmys

Sarmys is a beautiful and free WordPress theme for business websites. Featuring a clean and modern layout for the homepage with a large header image and call to action buttons at the top.

It includes custom headers support, background colors, custom logo and favicon, two navigation menus, social profiles menu, and more. It is easy to customize and all options can be accessed from theme customizer.

18. Modules

Modules

Modules is another great WordPress theme suitable for bars, pubs, nightclubs, cafes, and more. This versatile theme is designed to be super flexible and comes with several readymade websites that can be installed with 1-click.

It comes with modules for all the common web design elements. This allows you to just drag and drop modules anywhere on your pages to create truly dynamic layouts with no coding. It also has various header styles, navigation menus, custom widgets, social sharing, and many other customization options.

19. Carbone

Carbone

Carbone is a WordPress theme designed specifically for restaurant, bars, cafes, and similar businesses. It has a beautiful design that doesn’t require too much of your time and is quite easy to customize.

Inside you’ll find custom widgets, content discovery widgets, social sharing, unlimited colors, reservation form, and more. Carbone can be used with any page builder and it is compatible with all popular WordPress plugins and tools.

20. OceanWP

OceanWP

Need a highly flexible and powerful but free WordPress theme for your bar? OceanWP can do the trick. It is a highly customizable and free WordPress theme suitable for any kind of website. For a free WordPress theme, you’ll be surprised to find out how flexible this theme can be.

It supports all popular page builder plugins, so you can easily build any layouts you want. It also comes with multiple page templates, unlimited sidebars, custom widgets, header styles, backgrounds, and so much more.

21. Indigo

Indigo

Indigo can be another great choice for a WordPress theme for bars or pubs. It is designed to be flexible and can be used to build any kind of business website with just drag and drop. It ships with several readymade templates for complete websites. You can even import all the demo content with one click.

Inside you’ll discover their own page builder modules. These are content and design blocks that you can add to your pages and create your own designs. Indigo has custom widgets, multiple layouts, sidebars, page templates, icon fonts, and more. It is also quite simple to use and setup.

22. Liber

Liber

Liber provides another option to build a WordPress website for your bar. It is a beautifully designed theme for bars and pubs with an amazing set of features. It has food menu, testimonials, opening hours, and book a table features included.

It is quite easy to setup and uses live theme customizer so you can see your changes with a live preview. It is translation-ready, supports all eCommerce plugins, and ships with Soliloquy slider.

23. Parallax Pro

Parallax Pro

Parallax Pro is a high quality WordPress theme built on Genesis framework. This gives your bar website a rock solid code base that is highly optimized for speed and performance.

It uses beautiful Parallax effects on the homepage which is fully widgetized and you can easily set it up using live theme customizer. Parallax Pro does not have tons of options. It only has the features you’ll actually need to build a professional looking modern website.

24. Caboom

Caboom

Caboom is a multipurpose WordPress theme for business websites. It has an easy to setup homepage with drag and drop widgets and fully customizable slider. It has beautiful templates for galleries, blog posts, services, portfolio, and more.

It comes with 100+ shortcodes, unlimited sidebars, user your own colors, mega menu, Google Fonts, and custom logo support.

We hope this article helped you find the best WordPress theme for bars and pubs. You may also want to see our step by step WordPress SEO guide for beginners.

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 24 Best WordPress Themes for Bars and Pubs appeared first on WPBeginner.

How to Style Each WordPress Post Differently

Have you ever come across a site that style their blog posts differently? Some sites have sticky posts highlighted with a custom background whereas others may have each category post styled with a unique look. If you ever wanted to learn how to style each… Read More »

The post How to Style Each WordPress Post Differently appeared first on WPBeginner.

Have you ever come across a site that style their blog posts differently? Some sites have sticky posts highlighted with a custom background whereas others may have each category post styled with a unique look. If you ever wanted to learn how to style each WordPress posts differently, then you’re in the right place. In this article, we will show you how to style each WordPress post differently.

Style Each Post Differently

Note: This tutorial requires you to add custom CSS in WordPress. You will also need to be able to use the Inspect tool. Some basic CSS and HTML knowledge is required.

Styling Individual Posts in WordPress

WordPress adds default CSS classes to various elements on your website. A standard compliant WordPress theme must have the code required by WordPress to add CSS classes for body, posts, pages, widgets, menus, and more.

A core WordPress function called post_class() is used by themes to tell WordPress where to add those default CSS classes for posts.

If you visit your website and use the Inspect tool in your browser, then you will be able to see those classes added for each post.

Default CSS classes for WordPress post

Following are the CSS classes added by default based on what page a user is viewing.

  • .post-id
  • .post
  • .attachment
  • .sticky
  • .hentry (hAtom microformat pages)
  • .category-ID
  • .category-name
  • .tag-name
  • .format-{format-name}
  • .type-{post-type-name}
  • .has-post-thumbnail
  • .post-password-required
  • .post-password-protected

An example output would look like this:

<article id="post-412" class="post-412 post type-post status-publish format-standard hentry category-news">

You can style each WordPress post differently using the respective CSS classes.

For example, if you wanted to style an individual post, then you can use the post-id class in your custom CSS.

.post-412 { 
background-color: #FF0303;
color:#FFFFFF; 
} 

Don’t forget to change the post ID to match your own.

Styling a specific post in WordPress

Let’s take a look at another example.

This time we will style all posts filed under a specific category called news.

We can do this by adding the following custom CSS to our theme”

.category-news { 
    font-size: 18px;
    font-style: italic;
} 

This CSS will affect all posts filed under news category.

The Post Class Function

Theme developers use the post_class function to tell WordPress where to add the post classes. Usually it is in the <article> tag.

The post class function not only loads the default WordPress generated CSS classes, it also allows you to add your own classes.

Depending on your theme, you’ll find the post_class function in your single.php file or in the content template files. Normally, the code will look something like this:

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

You can add your own custom CSS class with an attribute like this:

<article id="post-<?php the_ID(); ?>" <?php post_class('longform-article'); ?>>

The post_class will print out respective default CSS classes along with your custom CSS class.

If you want to add multiple CSS classes, then you can define them as an array and then call them in the post_class function.

<?php 
$custom_classes = array(
		'longform-article',
		'featured-story',
		'interactive',
	);
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( $custom_classes ); ?>>

Style Posts Differently Based on Authors

The default CSS classes generated by the_posts function does not include author name as a CSS class.

If you want to customize the style of each post based on author, then you will need to first add the author name as a CSS class.

You can do this by using the following snippet:

<?php $author = get_the_author_meta('user_nicename'); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( $author ); ?>>

This code will add the user’s nicename as a CSS class. Nicename is a URL friendly name used by WordPress. It does not have spaces, and all characters are in lowercase which makes it perfect to use as a CSS class.

The above code will give you an output like this:

<article id="post-412" class="peter post-412 post type-post status-publish format-standard hentry category-news">

Now you can use .peter in your custom CSS to style all posts by this particular author to look different.

.peter { 
background-color:#EEE;
border:1px solid #CCC; 
}

Style Posts Based on Popularity using Comment Count

You may have seen sites with popular posts widgets which are sometimes based on comment counts. In this example, we will show you how to style posts differently using the comment count.

First, we need to get the comment count and associate a class with it.

To get the comment count, you’ll need to add the following code in your theme files. This code goes inside the WordPress loop, so you can add it just before the <article> tag as well.

<?php 
	$postid = get_the_ID();
	$total_comment_count = wp_count_comments($postid);
		$my_comment_count = $total_comment_count->approved;
	if ($my_comment_count <10) {
		$my_comment_count = 'new';
	} elseif ($my_comment_count >= 10 && $my_comment_count <20) {
		$my_comment_count = 'ermerging';
	} elseif ($my_comment_count >= 20) {
		$my_comment_count = 'popular';
	}
?>

This code checks comment count for the post being displayed and assigns them a value based on the count. For example, posts with less than 10 comments get a class called new, less than 20 are referred to as emerging, and anything over 20 comments is popular.

Next, you need to add the comment count CSS class to the post_class function.

<article id="post-<?php the_ID(); ?>" <?php post_class( $my_comment_count ); ?>>

This will add new, emerging, and popular CSS classes to all posts based on the number of comments each post has.

You can add custom CSS to style posts based on popularity:

.new {border: 1px solid #FFFF00;}
.emerging {border: 1px dashed #FF9933;}
.popular {border: 1px dashed #CC0000;}

We are just adding borders, you can add any CSS rules you want.

Style Posts Based on Custom Fields

Hardcoding CSS classes in your theme file limits you to only those specific CSS classes. What if you wanted to decide which CSS class to add to an article as you are writing it?

With custom fields, you can add CSS classes on the fly.

First you need to add a custom field to a post, so that you can test it out. Edit a post and scroll down to custom fields section.

Add post class as a custom field

Add post-class as the custom field name, and anything you want to use as CSS class in the value field.

Don’t forget to click on the ‘Add custom field’ button to store it and then save your post.

Next, edit your theme files to display your custom field as the post class.

<?php $custom_values = get_post_meta($post->ID, 'post-class'); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( $custom_values ); ?>>

It will output the following HTML:

<article id="post-412" class="trending post-412 post type-post status-publish format-standard hentry category-uncategorized">

You can now add custom CSS for the post_class you added using custom field.

.trending{
background-color:##ff0000;
}

Custom fields can have multiple values, so you can add multiple CSS classes using the same name.

There are many more ways to style WordPress posts individually. As your skills grow, you’ll keep discovering new ways to style posts using different conditions.

We hope this article helped you learn how to style each WordPress post differently. You may also want to see our ultimate list of the most wanted WordPress tips, tricks, and hacks.

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 How to Style Each WordPress Post Differently appeared first on WPBeginner.