How to Create a Facebook Like Box Popup in WordPress

Do you want to promote your Facebook page in WordPress with a popup? Lightbox popups work really well to convert visitors into subscribers, and they work even better when promoting your Facebook page. In this article, we will show you how to effectively promote your… Read More »

The post How to Create a Facebook Like Box Popup in WordPress appeared first on WPBeginner.

Do you want to promote your Facebook page in WordPress with a popup? Lightbox popups work really well to convert visitors into subscribers, and they work even better when promoting your Facebook page. In this article, we will show you how to effectively promote your Facebook page in WordPress with a lightbox popup without annoying your users.

Promoting your Facebook page with lightbox popup in WordPress

Why Use a Facebook Page Popup in WordPress?

Lightbox popups are frequently used for email list building and lead generation. They convert really well and that’s why you see them everywhere.

However, they are not just limited to email list building. You can displaying photos in a lightbox popup, offer content upgrades, display a contact form popup, and more.

While you can easily add the Facebook like box in your sidebar, it is less noticeable thus does not get you good results.

On the other hand, a lightbox popup is more noticeable and requires users to take action. This helps you quickly get more likes for your Facebook page.

That being said, let’s see how to add a lightbox popup to promote your Facebook page in WordPress.

Creating Lightbox Popup For Your Facebook Page in WordPress

For this tutorial, we’ll be using OptinMonster. It is the best lead generation software in the market because it helps you convert abandoning website visitors into subscribers and followers.

First thing you need to do is signup for an OptinMonster account. You’ll need at least the pro plan to use their canvas feature.

Next, you need to install and activate the OptinMonster plugin. For more details, see our step by step guide on how to install a WordPress plugin.

It is a connector plugin that helps connect your WordPress site to your OptinMonster account.

Upon activation, you need to click on the OptinMonster menu in your WordPress admin bar to enter your license key.

Add your OptinMonster API Key

You can find this information from your account dashboard on the OptinMonster website.

After entering your license key, you need to click on the ‘Create New Optin’ button at the top.

Create new optin

This will take you to the create new campaign page on OptinMonster website.

Now you need to select Lighbox as your campaign type and Canvas as your campaign template.

Create new campaign

OptinMonster will now you to enter a name for your campaign. This name will help you identify your campaign in your OptinMonster dashboard.

After that, OptinMonster will launch its campaign builder interface. You will see a live preview of your blank canvas template on the right and OM options on the left.

OptinMonster builder

First you need to add the website where you will be running this campaign.

After that, click on the ‘Optin’ tab to start designing your Facebook lightbox popup.

Design your Facebook lightbox popup

At this point, you will need the embed code for your Facebook page. You can get that by visiting the Facebook Page Plugin website in a new browser tab.

You will need to enter the URL of your Facebook page and adjust the width, height, and other display options for your like box. We recommend using 600px width and 350px height.

After that, click on the Get Code button.

This will bring up a popup where you need to click on the iFrame tab and copy the code.

iFrame code

Now switch back to the OptinMonster builder and paste the code under ‘Canvas custom HTML’ box.

Paste your Facebook page like box code

You’ll be able to immediately see the preview of your Facebook like box.

Next, click on the Save button at the top to store your changes and then click on the publish button to continue.

Save optin and continue

This will take you to the publish settings page for your optin. Toggle Status button to live to make this optin available for your website.

Enable optin for your website

Your Facebook lightbox popup is now ready to be displayed on your WordPress site.

Display Facebook Page Lightbox Popup in WordPress

Switch back to the WordPress admin area of your website and click on the OptinMonster tab. You will now see your newly created optin listed there. If you don’t see it, then click on the ‘Refresh Optins’ button.

Edit output settings

Click on the ‘Edit output settings’ link below your optin to continue.

On the next screen, make sure that the box next to ‘Enable optin on site?’ option is checked.

Enable lightbox popup on your WordPress site

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

OptinMonster also allows you to selectively display popup on different pages, posts, categories, or tags. You can also show or hide it from logged in users.

Once you are done, you can visit your website to see your Facebook Page displayed in a lightbox popup.

Facebook page shown in Lightbox popup

We hope this article helped you learn how to promote your Facebook page in WordPress with a lightbox popup. You may also want to see our list of WordPress plugins that will quickly help you get more traffic.

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 Facebook Like Box Popup in WordPress appeared first on WPBeginner.

How to Create a Facebook Like Box Popup in WordPress

Do you want to promote your Facebook page in WordPress with a popup? Lightbox popups work really well to convert visitors into subscribers, and they work even better when promoting your Facebook page. In this article, we will show you how to effectively promote your… Read More »

The post How to Create a Facebook Like Box Popup in WordPress appeared first on WPBeginner.

Do you want to promote your Facebook page in WordPress with a popup? Lightbox popups work really well to convert visitors into subscribers, and they work even better when promoting your Facebook page. In this article, we will show you how to effectively promote your Facebook page in WordPress with a lightbox popup without annoying your users.

Promoting your Facebook page with lightbox popup in WordPress

Why Use a Facebook Page Popup in WordPress?

Lightbox popups are frequently used for email list building and lead generation. They convert really well and that’s why you see them everywhere.

However, they are not just limited to email list building. You can displaying photos in a lightbox popup, offer content upgrades, display a contact form popup, and more.

While you can easily add the Facebook like box in your sidebar, it is less noticeable thus does not get you good results.

On the other hand, a lightbox popup is more noticeable and requires users to take action. This helps you quickly get more likes for your Facebook page.

That being said, let’s see how to add a lightbox popup to promote your Facebook page in WordPress.

Creating Lightbox Popup For Your Facebook Page in WordPress

For this tutorial, we’ll be using OptinMonster. It is the best lead generation software in the market because it helps you convert abandoning website visitors into subscribers and followers.

First thing you need to do is signup for an OptinMonster account. You’ll need at least the pro plan to use their canvas feature.

Next, you need to install and activate the OptinMonster plugin. For more details, see our step by step guide on how to install a WordPress plugin.

It is a connector plugin that helps connect your WordPress site to your OptinMonster account.

Upon activation, you need to click on the OptinMonster menu in your WordPress admin bar to enter your license key.

Add your OptinMonster API Key

You can find this information from your account dashboard on the OptinMonster website.

After entering your license key, you need to click on the ‘Create New Optin’ button at the top.

Create new optin

This will take you to the create new campaign page on OptinMonster website.

Now you need to select Lighbox as your campaign type and Canvas as your campaign template.

Create new campaign

OptinMonster will now you to enter a name for your campaign. This name will help you identify your campaign in your OptinMonster dashboard.

After that, OptinMonster will launch its campaign builder interface. You will see a live preview of your blank canvas template on the right and OM options on the left.

OptinMonster builder

First you need to add the website where you will be running this campaign.

After that, click on the ‘Optin’ tab to start designing your Facebook lightbox popup.

Design your Facebook lightbox popup

At this point, you will need the embed code for your Facebook page. You can get that by visiting the Facebook Page Plugin website in a new browser tab.

You will need to enter the URL of your Facebook page and adjust the width, height, and other display options for your like box. We recommend using 600px width and 350px height.

After that, click on the Get Code button.

This will bring up a popup where you need to click on the iFrame tab and copy the code.

iFrame code

Now switch back to the OptinMonster builder and paste the code under ‘Canvas custom HTML’ box.

Paste your Facebook page like box code

You’ll be able to immediately see the preview of your Facebook like box.

Next, click on the Save button at the top to store your changes and then click on the publish button to continue.

Save optin and continue

This will take you to the publish settings page for your optin. Toggle Status button to live to make this optin available for your website.

Enable optin for your website

Your Facebook lightbox popup is now ready to be displayed on your WordPress site.

Display Facebook Page Lightbox Popup in WordPress

Switch back to the WordPress admin area of your website and click on the OptinMonster tab. You will now see your newly created optin listed there. If you don’t see it, then click on the ‘Refresh Optins’ button.

Edit output settings

Click on the ‘Edit output settings’ link below your optin to continue.

On the next screen, make sure that the box next to ‘Enable optin on site?’ option is checked.

Enable lightbox popup on your WordPress site

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

OptinMonster also allows you to selectively display popup on different pages, posts, categories, or tags. You can also show or hide it from logged in users.

Once you are done, you can visit your website to see your Facebook Page displayed in a lightbox popup.

Facebook page shown in Lightbox popup

We hope this article helped you learn how to promote your Facebook page in WordPress with a lightbox popup. You may also want to see our list of WordPress plugins that will quickly help you get more traffic.

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 Facebook Like Box Popup in WordPress appeared first on WPBeginner.

How to Manage Ads in WordPress with AdRotate Plugin

Banner ads are one of the most common ways to make money from your blog. Many bloggers use an ad management software to maximize their ad earnings without ruining the user experience. In this article, we will show you how to manage ads in WordPress… Read More »

The post How to Manage Ads in WordPress with AdRotate Plugin appeared first on WPBeginner.

Banner ads are one of the most common ways to make money from your blog. Many bloggers use an ad management software to maximize their ad earnings without ruining the user experience. In this article, we will show you how to manage ads in WordPress with the AdRotate plugin.

Why use a WordPress Ad Management Plugin?

Advertising programs like Google Adsense and others require publishers to add a code snippet on their website for displaying ads.

As a WordPress publisher, you can do this by either editing the code in your theme files or by using an ad management plugin.

If you are a beginner who just started your blog, then adding code into theme files is not an ideal solution. You cannot properly manage different ad sizes or their placements. You also increase your chances of messing up and causing unexpected WordPress errors.

On the other hand, using an ad management plugin allows you to easily insert ads anywhere on your website. You can save multiple ad codes, rotate them, and show / hide ads on different pages.

Let’s take a look at how to manage ads in WordPress like a pro using the AdRotate plugin.

Manage Ads in WordPress with AdRotate

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

Upon activation, you need to visit AdRotate » Adverts page and click on the ‘Add New’ link to create your first ad.

Add new ad

This will bring you to the add new ad page. You need to provide a title for your ad because it will help you identify this ad inside the WordPress admin area.

After that, you can paste the ad code generated by your advertising network like Adsense. Alternatively, you can also generate your own ad code if you are running self-hosted ads.

Creating ad

For hosted ads, you can upload banner images and enable click tracking.

You need to select the activate option to make this ad available on your WordPress site.

Next, you need to scroll down on the page to the usage and schedule section. Here you can schedule your ad and get the shortcode which you can add to your posts, pages, or sidebar widgets.

Don’t forget to click on the ‘Save Advert’ button to store your settings.

You can repeat this process to create as many ads you want and then decide which ads you want to be displayed on your site.

Grouping Your Ads Together

Many WordPress bloggers join multiple advertising networks and partner programs. You may also have advertising spaces on different locations and in different sizes.

Grouping allows you to easily sort your ads into different categories for easier management.

To create a new group, head over to AdRotate » Groups page and click on the ‘Add New’ link.

Add new group

This will bring you to the create new group page.

First you need to provide a title for your group. This will allow you to easily identify the group in your WordPress admin area.

Ad group settings

Next, you need to choose a display mode. AdRotate allows you to customize how you display ads from a specific group.

For example, you can display one ad from the group at a time, a block of ads, or dynamic mode which changes the ad after few seconds.

Next, you can select the group auto display options. AdRotate allows you to automatically insert ads from a group into posts, pages, and sidebar widgets.

Auto insert ads into posts and pages

At the bottom of the page, you will see all your ads that you can associate with that group. Simply select the ads that you want to include and then click on ‘Save Group’ button.

Manually Inserting Ads in WordPress

While you can associate your ads to groups and automatically insert them into posts, pages, categories, and widgets, some publishers may want to have more granular control on which ads to display on which location.

AdRotate makes it super easy to insert ads anywhere on your WordPress site.

Each ad you create on your site has its own shortcode that you can copy and paste into your WordPress posts or pages and even custom post types.

Go to AdRotate » Adverts and click on any ad to edit it. On the Edit Ad page, you need to scroll down to the usage section to copy the shortcode.

Ad shortcode

Similarly, you can also edit a group to get the shortcode and then use it anywhere on your website.

If you want to display ads in your WordPress sidebar, then go to Appearance » Widgets page and add the AdRotate widget to your sidebar.

AdRotate Widget

We hope this article helped you learn how to manage ads in WordPress with the AdRotate plugin. You may also want to see our ultimate 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 How to Manage Ads in WordPress with AdRotate Plugin appeared first on WPBeginner.

Experimental: Reducing the size of .NET Core applications with Mono’s Linker

The .NET team has built a linker to reduce the size of .NET Core applications. It is built on top of the excellent and battle-tested mono linker. The Xamarin tools also use this linker so it makes sense to try it out and perhaps use it everywhere!

“In trivial cases, the linker can reduce the size of applications by 50%. The size wins may be more favorable or more moderate for larger applications. The linker removes code in your application and dependent libraries that are not reached by any code paths. It is effectively an application-specific dead code analysis.” – Using the .NET IL Linker

I recently updated a 15 year old .NET 1.1 application to cross-platform .NET Core 2.0 so I thought I’d try this experimental linker on it and see the results.

The linker is a tool one can use to only ship the minimal possible IL code and metadata that a set of programs might require to run as opposed to the full libraries. It is used by the various Xamarin products to extract only the bits of code that are needed to run an application on Android, iOS and other platforms.

I’ll add this line to a nuget.config in my project’s folder. Note that NuGet will inherit global settings and ADD this line.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
</packageSources>
</configuration>

Then I’ll add the IL Linker’s NuGet package to my project with this command line command (or from Visual Studio):

dotnet add package ILLink.Tasks -v 0.1.4-preview-906439

The assemblies will automatically be “trimmed” when they are published (not built) so I’ll build it twice, disabling it with a switch:

D:\github\TinyOS\OS Project>dotnet publish -c release -r win-x64 -o notlinked /p:LinkDuringPublish=false
Microsoft (R) Build Engine version 15.3 for .NET Core

TinyOSCore -> D:\github\TinyOS\OS Project\bin\Release\netcoreapp2.0\win-x64\TinyOSCore.dll
TinyOSCore -> D:\github\TinyOS\OS Project\notlinked\

D:\github\TinyOS\OS Project>dotnet publish -c release -r win-x64 -o linked
Microsoft (R) Build Engine version 15.3 for .NET Core

TinyOSCore -> D:\github\TinyOS\OS Project\bin\Release\netcoreapp2.0\win-x64\TinyOSCore.dll
TinyOSCore -> D:\github\TinyOS\OS Project\linked\

And here’s the results:

image

You can also run it with  /p:ShowLinkerSizeComparison=true and get a nice table. I’ve trimmed the table as it’s super long.

  TinyOSCore -> D:\github\TinyOS\OS Project\bin\Release\netcoreapp2.0\win-x64\TinyOSCore.dll
Before linking (B) After linking (B) Size decrease
----------- ----------- ----------- -----------
Total size of assemblies 48,025,824 16,740,056 65.14%
----------- ----------- ----------- -----------
TinyOSCore.dll 36,352 36,352 0.00%
Microsoft.Extensions.Configuration.dll 24,584 24,584 0.00%
Microsoft.Extensions.Configuration.Abstractions.dll 20,480 20,480 0.00%
Microsoft.Extensions.Configuration.Binder.dll 24,064 24,064 0.00%
Microsoft.Extensions.Configuration.FileExtensions.dll 22,528 22,528 0.00%
Microsoft.Extensions.Configuration.Json.dll 24,072 24,072 0.00%
Microsoft.Extensions.DependencyInjection.dll 46,600 46,600 0.00%
Microsoft.Extensions.DependencyInjection.Abstractions.dll 35,336 35,336 0.00%
Microsoft.Extensions.FileProviders.Abstractions.dll 17,920 17,920 0.00%
Microsoft.Extensions.FileProviders.Physical.dll 31,240 31,240 0.00%
Microsoft.Extensions.FileSystemGlobbing.dll 39,432 39,432 0.00%
Microsoft.Extensions.Options.dll 26,120 26,120 0.00%
Microsoft.Extensions.Options.ConfigurationExtensions.dll 16,904 16,904 0.00%
Microsoft.Extensions.Primitives.dll 33,800 33,800 0.00%
Newtonsoft.Json.dll 639,488 639,488 0.00%
Microsoft.CSharp.dll 1,092,096 392,192 64.09%
Microsoft.VisualBasic.dll 465,416 0 100.00%
Microsoft.Win32.Primitives.dll 18,968 4,608 75.71%
Microsoft.Win32.Registry.dll 85,008 0 100.00%
SOS.NETCore.dll 54,264 0 100.00%
System.AppContext.dll 14,336 2,560 82.14%
System.Buffers.dll 14,336 2,560 82.14%
System.Collections.Concurrent.dll 206,360 31,744 84.62%
System.Collections.Immutable.dll 2,378,264 0 100.00%
System.Collections.NonGeneric.dll 96,792 24,576 74.61%
System.Collections.Specialized.dll 88,608 15,360 82.67%
System.Collections.dll 326,664 52,224 84.01%

TinyOSCore -> D:\github\TinyOS\OS Project\bin\Release\netcoreapp2.0\win-x64\publish\

You can see in some places where there’s no size decrease. That’s because I’m using those assemblies completely. Some see a 100% decrease – they’ve been removed entirely – because I’m not using the Registry, for example. And some see a fractional decrease because I’m using some methods but not others.

You can check out the full instructions and try this yourself at https://github.com/dotnet/core/blob/master/samples/linker-instructions.md. Again, it’s a work in progress.


Sponsor: Check out JetBrains Rider: a new cross-platform .NET IDE. Edit, refactor, test and debug ASP.NET, .NET Framework, .NET Core, Xamarin or Unity applications. Learn more and download a 30-day trial!


© 2017 Scott Hanselman. All rights reserved.
     

The .NET team has built a linker to reduce the size of .NET Core applications. It is built on top of the excellent and battle-tested mono linker. The Xamarin tools also use this linker so it makes sense to try it out and perhaps use it everywhere!

"In trivial cases, the linker can reduce the size of applications by 50%. The size wins may be more favorable or more moderate for larger applications. The linker removes code in your application and dependent libraries that are not reached by any code paths. It is effectively an application-specific dead code analysis." - Using the .NET IL Linker

I recently updated a 15 year old .NET 1.1 application to cross-platform .NET Core 2.0 so I thought I'd try this experimental linker on it and see the results.

The linker is a tool one can use to only ship the minimal possible IL code and metadata that a set of programs might require to run as opposed to the full libraries. It is used by the various Xamarin products to extract only the bits of code that are needed to run an application on Android, iOS and other platforms.

I'll add this line to a nuget.config in my project's folder. Note that NuGet will inherit global settings and ADD this line.

<?xml version="1.0" encoding="utf-8"?>

<configuration>
<packageSources>
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
</packageSources>
</configuration>

Then I'll add the IL Linker's NuGet package to my project with this command line command (or from Visual Studio):

dotnet add package ILLink.Tasks -v 0.1.4-preview-906439

The assemblies will automatically be "trimmed" when they are published (not built) so I'll build it twice, disabling it with a switch:

D:\github\TinyOS\OS Project>dotnet publish -c release -r win-x64 -o notlinked /p:LinkDuringPublish=false

Microsoft (R) Build Engine version 15.3 for .NET Core

TinyOSCore -> D:\github\TinyOS\OS Project\bin\Release\netcoreapp2.0\win-x64\TinyOSCore.dll
TinyOSCore -> D:\github\TinyOS\OS Project\notlinked\

D:\github\TinyOS\OS Project>dotnet publish -c release -r win-x64 -o linked
Microsoft (R) Build Engine version 15.3 for .NET Core

TinyOSCore -> D:\github\TinyOS\OS Project\bin\Release\netcoreapp2.0\win-x64\TinyOSCore.dll
TinyOSCore -> D:\github\TinyOS\OS Project\linked\

And here's the results:

image

You can also run it with  /p:ShowLinkerSizeComparison=true and get a nice table. I've trimmed the table as it's super long.

  TinyOSCore -> D:\github\TinyOS\OS Project\bin\Release\netcoreapp2.0\win-x64\TinyOSCore.dll

Before linking (B) After linking (B) Size decrease
----------- ----------- ----------- -----------
Total size of assemblies 48,025,824 16,740,056 65.14%
----------- ----------- ----------- -----------
TinyOSCore.dll 36,352 36,352 0.00%
Microsoft.Extensions.Configuration.dll 24,584 24,584 0.00%
Microsoft.Extensions.Configuration.Abstractions.dll 20,480 20,480 0.00%
Microsoft.Extensions.Configuration.Binder.dll 24,064 24,064 0.00%
Microsoft.Extensions.Configuration.FileExtensions.dll 22,528 22,528 0.00%
Microsoft.Extensions.Configuration.Json.dll 24,072 24,072 0.00%
Microsoft.Extensions.DependencyInjection.dll 46,600 46,600 0.00%
Microsoft.Extensions.DependencyInjection.Abstractions.dll 35,336 35,336 0.00%
Microsoft.Extensions.FileProviders.Abstractions.dll 17,920 17,920 0.00%
Microsoft.Extensions.FileProviders.Physical.dll 31,240 31,240 0.00%
Microsoft.Extensions.FileSystemGlobbing.dll 39,432 39,432 0.00%
Microsoft.Extensions.Options.dll 26,120 26,120 0.00%
Microsoft.Extensions.Options.ConfigurationExtensions.dll 16,904 16,904 0.00%
Microsoft.Extensions.Primitives.dll 33,800 33,800 0.00%
Newtonsoft.Json.dll 639,488 639,488 0.00%
Microsoft.CSharp.dll 1,092,096 392,192 64.09%
Microsoft.VisualBasic.dll 465,416 0 100.00%
Microsoft.Win32.Primitives.dll 18,968 4,608 75.71%
Microsoft.Win32.Registry.dll 85,008 0 100.00%
SOS.NETCore.dll 54,264 0 100.00%
System.AppContext.dll 14,336 2,560 82.14%
System.Buffers.dll 14,336 2,560 82.14%
System.Collections.Concurrent.dll 206,360 31,744 84.62%
System.Collections.Immutable.dll 2,378,264 0 100.00%
System.Collections.NonGeneric.dll 96,792 24,576 74.61%
System.Collections.Specialized.dll 88,608 15,360 82.67%
System.Collections.dll 326,664 52,224 84.01%

TinyOSCore -> D:\github\TinyOS\OS Project\bin\Release\netcoreapp2.0\win-x64\publish\

You can see in some places where there's no size decrease. That's because I'm using those assemblies completely. Some see a 100% decrease - they've been removed entirely - because I'm not using the Registry, for example. And some see a fractional decrease because I'm using some methods but not others.

You can check out the full instructions and try this yourself at https://github.com/dotnet/core/blob/master/samples/linker-instructions.md. Again, it's a work in progress.


Sponsor: Check out JetBrains Rider: a new cross-platform .NET IDE. Edit, refactor, test and debug ASP.NET, .NET Framework, .NET Core, Xamarin or Unity applications. Learn more and download a 30-day trial!



© 2017 Scott Hanselman. All rights reserved.
     

Top 10 Must Have iPhone Apps for Bloggers

Looking for the best iPhone apps for bloggers that you should install? You’re probably already using multiple apps on your iPhone to assist with blogging. In this article, we have shared our hand-picked top 10 must have iPhone apps for bloggers, WordPress users, and online… Read More »

The post Top 10 Must Have iPhone Apps for Bloggers appeared first on WPBeginner.

Looking for the best iPhone apps for bloggers that you should install? You’re probably already using multiple apps on your iPhone to assist with blogging. In this article, we have shared our hand-picked top 10 must have iPhone apps for bloggers, WordPress users, and online marketers.

Must have iPhone apps for bloggers

1. WordPress.com Apps

WordPress.com Apps

WordPress.com offers beautifully designed apps to manage your WordPress.com as well as self hosted WordPress.org websites. See our guide on the difference between WordPress.com vs WordPress.org for more details.

The app is available for iOS, Android, as well as desktop computers. It allows you to write and edit posts on the go, share photos, get push notifications, and manage comments.

One downside of using the app is that some of its features, like stats, would require you to create a WordPress.com account and install JetPack on your site. However these features are optional, and you can still use the app without using those features.

2. Ulysses

Ulysses

If you are looking for a killer writing experience on your iPhone, then checkout Ulysses. It is an award winning paid app, and you will love the writing experience it offers.

The app basically gets out of your way when you are writing, allowing you to be more productive even on smaller screen. It is a writing app that works with WordPress and Medium. You can share and open files with Notes, Google Drive, DropBox, and more.

It also comes with intuitive organization for all your writing projects making it easier to stay organized while on the go. Text editing uses markdown syntax allowing you to be able to write freely without constantly tapping small buttons to format or add links.

3. Feedly

Feedly

Want to read all your favorite websites and blogs on the go? Then checkout Feedly. It is the smartest way to subscribe to your favorite websites, read them whenever you want, and on whichever device you are using. Feedly is available for browsers, desktop, iOS, Android, and more.

It is probably the best RSS feed reader on the market. Offering a clean and clear reading experience, intelligent tracking of what you have read, and easier tools to organize your subscriptions.

4. Snapseed

Snapseed

Your iPhone comes with a great camera and sometimes you may need to edit photos on the go using your iPhone. Unfortunately, out of the box it doesn’t come with advanced image editing tool that can do all the things you want to do. This is where Snapseed comes in.

Created by Google, Snapseed is an advanced photo editing app for mobile devices. It is available for both Android and iPhone, and has some really amazing features like healing brush, edit history, filters, color and light balance, and more.

You’ll be surprised how easy Snapseed makes it to use taps and gestures for advanced editing features. It is a must have app for your iPhone if you regularly share photos from your phone.

5. IFTTT

IFTTT

Do you sometimes wish that someone could automate several aspects of your blogging and social media? IFTTT is that virtual assistant you’ve been wishing for.

It allows you to automate your social media, blogging, mobile usage, and internet of things.

Basically, you just set conditions for different apps, and when those conditions are matched IFTTT performs the actions you have defined. For example, it can tweet your new articles, share them on Facebook, retweet articles, and lots more.

See our guide on how to automate WordPress and social media with IFTTT for more details.

6. Google Authenticator

Google Authenticator

One of the most important tip you will find in our WordPress security guide is to enable two step verification for your WordPress login screen. Google Authenticator is the app you will need to enable it.

It generates time-sensitive passwords that you will need to enter along with your WordPress password. Since these passwords are generated on your mobile device and only for a short time, hackers will not be able to easily break into your website.

For detailed instructions, see our guide on how to add Google Authenticator 2-step verification in WordPress.

7. LastPass

LastPass

There are identity thieves, malware, and cyber attacks lurking in the dark corners of the internet. Your first line of defense against these threats are your passwords. You should always use unique strong passwords for all your online accounts. Now, the question is how to keep track of all those strong passwords?

You don’t need to. LastPass is a password manager app that works on all browsers, operating systems, and even on your iPhone. It allows you to automatically save and enter passwords. You can also safely share your passwords with co-workers without them being able to look at the password.

For more on this topic, see our guide on how to manage passwords for WordPress beginners.

Alternate: Authy, 1Password

8. Pushbullet

Pushbullet

Pushbullet is a neat app that allows you to share files between your devices. It works on all operating systems, iPhone, Android, plus all major browsers. This comes in particularly handy when you want to send a file from one device to another without syncing all your files.

It also allows you to view notifications from your phone in your browser or desktop. You can also view and send text messages to your phone from your desktop.

9. Hootsuite

Hootsuite

While the default social media apps work just fine for most users, they miss out on many features that you’d need as a blogger, online marketer, or a business owner.

Some of these features include scheduling, social media monitoring, analytics, unified dashboard, collaboration, etc. Hootsuite is probably the most popular app that offers all these features under a beautiful simplified dashboard.

10. Evernote

Evernote

Evernote has been the number one choice among bloggers as their favorite note taking app. It is powerful and intuitive allowing you to take notes, save links, set reminders, and share them across all your devices. You can also share notes with anyone using Evernote or any third party app on your device.

On top of that, Evernote works seamlessly with apps like, Feedly, IFTTT, Google Drive, Notes, and more. This offers you greater flexibility and a whole lot of ways to save and share your notes.

Alternative: Google Keep

We hope this article helped you find some new must have iPhone apps for bloggers. You may also want to see our list of the free Google tools every WordPress blogger should use.

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 Top 10 Must Have iPhone Apps for Bloggers appeared first on WPBeginner.

21 Best WordPress Themes for Car Dealerships

Trying to find the best WordPress themes for car dealerships? While there are thousands of WordPress themes out there, it can be difficult to find one that lets you showcase your car dealership. In this article, we will show the best WordPress themes for car… Read More »

The post 21 Best WordPress Themes for Car Dealerships appeared first on WPBeginner.

Trying to find the best WordPress themes for car dealerships? While there are thousands of WordPress themes out there, it can be difficult to find one that lets you showcase your car dealership. In this article, we will show the best WordPress themes for car dealerships that you can try right away.

WordPress themes for car dealerships

Creating a Car Dealership Website with WordPress

Thousands of businesses, including some big name brands are already using WordPress to run their websites. It is also a popular choice among car dealerships.

Before getting started, make sure that you are choosing the right platform. A self-hosted WordPress.org site will give you access to all features of WordPress (see our comparison: WordPress.com vs wordPress.org).

Self hosted WordPress sites need a WordPress hosting account and a domain name.

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

Once you have signed for hosting, head over to our how to make a website guide for step by step WordPress installation instructions.

Once you’re ready, let’s take a look at some of the best WordPress themes for car dealerships.

1. Motors

Motors

Motors is a WordPress theme beautifully designed for car dealerships, used car dealers, and other automobile businesses. It has 6 ready-made website templates that you can install with 1-click. It also includes a powerful search and filter feature allowing users to easily look for cars and vehicles of their choice.

Other noteable features include dealer pages, Google Maps integration, sell your vehicle forms, and more. It offers an easier theme setup with custom options panel with tons of customization features.

2. Intrigue

Intrigue

Intrigue is a beautiful WordPress theme with a bold color scheme and modern stylish look. It comes with a default red and black color scheme that gives your car dealership website a unique look. It is designed to be a multipurpose theme suitable for all kind of businesses including car dealerships.

If you don’t want to use bold colors, then it also has other color schemes that you can use right away. It has an easy to setup homepage, custom widgets for Twitter and Instagram, and easy theme customization options. It also allows you to add an online store to your website using WooCommerce.

3. Auto Trader

Auto Trader

Auto Trader is designed specifically for car dealerships, used car dealers, and car repair websites. It has tons of customization options which make it very flexible to match your needs. It includes unlimited color choices, custom CSS animations, multiple slider options, and a mega menu.

Inside you will also find a FAQs section, pricing page, car markers, and services templates. Theme setup is quite easy with a custom theme options panel with detailed instructions.

4. Automax

Automax

Automax is a WordPress theme designed specifically for car dealerships, auto repair, and auto traders. It comes with a vin decoder tool. This tool allows you to just add a vehicle’s vin number and then it automatically fills in all the details for you.

It has beautiful templates to display your listings and a powerful search and filter system. It also includes a powerful inventory management feature to display your vehicle inventory. Other features include color customizations, custom widgets, and a built-in finance calculator.

5. Expert Auto

Expert Auto

ExpertAuto is a powerful WordPress theme for car dealerships, car enthusiasts, and auto repair websites. Theme homepage features a modern layout with beautiful parallax background effects. It also includes a simple drag and drop page builder.

Theme options can be easily setup using the live customizer. Inside you’ll also find support for Google fonts, Google Maps, a sidebar manager, and a full-fledged appointment management system.

6. Automotive

Automotive

Automative comes with a powerful vin decoder tool to easily fill in your inventory by simply entering the vin code. This powerful WordPress theme is designed from scratch for car dealerships.

It offers unlimited colors, a beautiful slider, and a custom contact form for customer to provider their car information. Theme setup is quite easy with a custom theme options panel that walks you through the setup process.

7. Monochrome

Monochrome

Looking for a beautiful WordPress theme with minimalist approach to design? Check out Monochrome. Designed by StudioPress and built on top of their powerful Genesis theme framework, Monochrome is perfect for any kind of business including car dealerships.

Its clean spacious layout and gorgeous display of images makes your car photographs pop out. It is super easy to use with a widgetized homepage layout that allows you to just drag and drop widgets to setup homepage. It has beautiful templates for different pages and it is WooCommerce ready out of the box.

8. Automan WP

Automan WP

Automan WP is a beautifully designed WordPress theme for car dealership websites. It comes with a custom plugin to add car listings, and add a search and filter feature. It features a beautiful modern homepage layout with smooth CSS animations, parallax, and smooth scrolling effects.

Other notable features include multiple color schemes, page templates, sidebar generator, shortcodes, icon fonts, and more. It has a custom theme options panel to setup your theme and ships with a premium page builder plugin to create additional custom page layouts.

9. Car Dealer

Car Dealer

Car Dealer is a powerful WordPress theme custom made for car dealership websites. It allows you to easily add vehicle listings to your website with photos and detailed information. It has a vin decoder tool that fetches vehicle information and automatically fills information into your listings.

It is easy to setup and has a simpler theme options panel. It has beautiful templates for single cars, with gorgeous photo galleries, sliders, and detailed vehicle information. It has unlimited colors, custom templates, social media integration, and custom request information contact form.

10. CarClinic

CarClinic

Car Clinic is modern WordPress theme for car repair, dealerships, and used cars websites. It is highly customizable and allows you to import demo content with a single click. After that, just replace the images and content with your own and you are good to go.

Other features include custom logo upload, Google Analytics integration, social media, unlimited sidebars, and more. It also has staff profiles and customer testimonial sections and an easy to use theme dashboard.

11. Bennet

Bennet

Bennet is an elegantly designed WordPress theme for car dealerships, mechanics, and car services websites. It comes with an easy to use drag and drop page builder with content blocks quickly build your own page layouts.

It has ready to use templates for your homepage, blog, and landing pages with multiple layout choices. On top of that, it also ships with a simple appointment booking system as well.

12. The Automobile

The Automobile

If you are looking for a simpler and free option, then take a look at The Automobile. It is a free WordPress theme with a decent set of customization features. It allows you to easily add your business address and phone number at the top.

It has a modern homepage layout with different sections, animations, and scrolling effects. All theme options can be easily setup using live theme customizer. It is also compatible with most popular page builders.

13. Atomic

Atomic

Atomic is an elegant and modern WordPress business theme. The most notable feature of the theme is its crisp typography and beautiful display of images, which makes it ideal for car dealership website.

It comes with elegantly designed portfolio templates that can be repurposed to use for car listings. Atomic is also super easy to use and includes only the features you will actually use in a clutter free setup.

14. CarZine

CarZine

As the name suggests, CarZine is a free WordPress theme for car magazines, blogs, and dealerships. It comes with a simple theme features panel where you can upload favicon or site icon, custom logo, add social profiles, featured content slider, and more.

It comes in a dark color scheme but you can also change colors to meet your own needs. It also supports live customizer to add widgets, navigation menus, and customize homepage.

15. Spark

Spark

Spark is feature rich WordPress theme designed to be easily repurposed for any kind of website. Its flexibility and tons of customization options make it an ideal candidate for car dealership websites.

It is available in boxed and full-width mode with many layout choices. It comes with freebies like premium slider and page builder plugins. It is also ready for eCommerce with full WooCommerce support and beautiful product templates.

16. Float

Float

Float is a multipurpose WordPress theme with an integrated drag and drop page builder. It has multiple header styles, layout choices, page templates, custom widgets, and more. All these features make it a great choice to build a car dealership website.

To make things even easier, it also includes several readymade websites that can be installed with 1-click. It is quite easy to setup with a simpler theme settings page.

17. The Core

The Core

The Core is a bundle of readymade turnkey WordPress designs packed inside a mega theme. Simply select a website you’ll like to use as an starting point, and it will fetch all its content. It has an integrated page builder so changing page layouts or even creating new ones is a breeze.

It has dozens of page styles, blog layouts, templates, custom widgets, and more. It also supports easy color selection and live theme customization.

18. Presence

Presence

Presence is designed for businesses to build their online presence using a modern design. Due to its ease of use and flexible options, Presence is perfect for a car dealership website. It comes in multiple color schemes, and you can also create your own color schemes.

The homepage features a business layout with a slider and navigation menu on top, followed by your services and other sections. It has 10 demos that you can install and all theme options can be easily changed with simple controls.

19. Cherry

Cherry

Cherry is a multipurpose WordPress theme with three websites packed inside it. One of the demo websites is for car repair, and dealership websites. It includes multiple styles, layouts, and page templates allowing you to mix and match to create highly engaging pages.

Other features include Google fonts, icon fonts, social sharing, and WooCommerce support. It can also be used to create multilingual websites using WPML.

20. Car Dealer

Car Dealer

Car Dealer is a dark WordPress car dealership theme with a unique design. The homepage features a large slider at the top, which is followed by your most important content. It has full width page template, single post template with a right sidebar.

It has a portfolio section that can be used to showcase your car listings. It also has templates to display your photo galleries. Other features include team, services, and testimonials sections, and WPML support for multilingual websites.

21. Auril

Auril

Auril is a clean and well designed WordPress theme for car repairs, dealerships, and automobile blogs. It comes with a plethora of options and 18 predefined skins. You can also create your own skins using the page builder.

It is translation ready and compatible with WPML multilingual plugin. Other notable features include business hours widget, services and portfolio sections, icon fonts, and WooCommerce support.

We hope this article helped you find the best WordPress themes for car dealerships. You may also want to see our list of must have 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 21 Best WordPress Themes for Car Dealerships appeared first on WPBeginner.

How to Create a WordPress Intranet for Your Organization

Do you want to create a WordPress intranet for your organization? WordPress is a powerful platform with tons of flexible options that makes it ideal to be used as your company’s intranet. In this article, we will show you how to create a WordPress intranet… Read More »

The post How to Create a WordPress Intranet for Your Organization appeared first on WPBeginner.

Do you want to create a WordPress intranet for your organization? WordPress is a powerful platform with tons of flexible options that makes it ideal to be used as your company’s intranet. In this article, we will show you how to create a WordPress intranet for your organization while keeping it private and secure.

Creating a WordPress intranet for your organization

What is Intranet or Extranet? Why Use WordPress as Your Intranet Platform?

Intranet or Extranet is a communications platform used by an organization for communication, file sharing, announcements, and other organizational activities.

WordPress is an excellent platform to build your organization’s intranet or extranet. It is easy to maintain, open source, and gives you access to thousands of WordPress plugins to add new features when needed.

An intranet runs on an organization’s private network. Typically, an office IT system is connected via cable or wireless network adapters. One computer on the network can be used as the web server and host a WordPress website.

Follow the instructions in our guide on how to install WordPress on a Windows network using WAMP or install WordPress on a Mac computer using MAMP to start your WordPress intranet.

On the other hand, an extranet is an intranet platform accessible to a larger network or public internet. In plain English, this could be a website publicly accessible but restricted to authorized users only.

It is particularly useful if your organization is distributed across different geographic locations.

To create your WordPress extranet, you’ll need a WordPress hosting account and a domain name. After that, you can install WordPress and then set it up to be used as your organization’s intranet.

Once you have installed WordPress as your intranet, the next step is to convert it into a communications hub for your organization.

To do that, you’ll be using several WordPress plugins. We will show you the basic setup that will serve as the foundation for your WordPress intranet to grow and meet your organization’s goals.

Setting Up BuddyPress as Your WordPress Intranet Hub

BuddyPress is a sister project of WordPress. It converts your WordPress website into a social network. Here are some of the things a BuddyPress powered intranet can do:

  • You will be able to invite users to register on company intranet
  • Users will be able to create extended user profiles
  • Activity streams allow users to follow latest updates like Twitter or Facebook
  • You will be able to create user groups to sort users into departments or teams
  • Users can follow each other as friends
  • Users can send private messages to each other
  • You can add new features by adding third-party plugins
  • You’ll have plenty of design options with WordPress themes for BuddyPress

To get started, first you will need to install and activate BuddyPress plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, head over to Settings » BuddyPress page to configure plugin settings.

BuddyPress settings

For complete step by step instructions see our guide on how to turn WordPress into a social network with BuddyPress.

Secure Your WordPress Intranet with All-in-One Intranet

If you are running a WordPress intranet on local server, then you can secure it by limiting access to internal IPs in your .htaccess file.

However, if you are running an Extranet, then your users may be accessing the intranet from different networks and IP addresses.

To make sure that only authorized users get access to your company intranet, you need to make your extranet private and accessible to only registered users.

For that, you’ll need to install and activate the All-in-One Intranet plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, head over to Settings » All-in-One Intranet page to configure the plugin settings.

All in One Intranet settings

First you need to check the box next to ‘Force site to be entirely private’ option. This will make all pages of your WordPress site completely private.

The only thing this plugin will not make private is the files in your uploads directory. Don’t worry, we will show you how to protect it later in this article.

Next, you need to provide a URL where you want users to be redirected when they are logged in. This could be any page on your intranet.

Lastly, you can automatically logout inactive users after a certain number of minutes.

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

Securing Media Uploads on your WordPress Intranet

Making your website completely private doesn’t affect media files. If someone knows the exact URL of a file, then they can access it without any restriction.

Let’s change that.

For better protection, we will be redirecting all requests made to the uploads folder to a simple PHP script.

This php script will check if a user is logged in. If they are, then it will serve the file. Otherwise, the user will be redirected to the login page.

First you need to create a new file on your computer using a plain text editor like Notepad. After that you need to copy and paste the following code and save the file as download-file.php on your desktop.

<?php
require_once('wp-load.php');

is_user_logged_in() ||  auth_redirect();

list($basedir) = array_values(array_intersect_key(wp_upload_dir(), array('basedir' => 1)))+array(NULL);

$file =  rtrim($basedir,'/').'/'.str_replace('..', '', isset($_GET[ 'file' ])?$_GET[ 'file' ]:'');
if (!$basedir || !is_file($file)) {
	status_header(404);
	die('404 — File not found.');
}

$mime = wp_check_filetype($file);
if( false === $mime[ 'type' ] && function_exists( 'mime_content_type' ) )
	$mime[ 'type' ] = mime_content_type( $file );

if( $mime[ 'type' ] )
	$mimetype = $mime[ 'type' ];
else
	$mimetype = 'image/' . substr( $file, strrpos( $file, '.' ) + 1 );

header( 'Content-Type: ' . $mimetype ); // always send this
if ( false === strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) )
	header( 'Content-Length: ' . filesize( $file ) );

$last_modified = gmdate( 'D, d M Y H:i:s', filemtime( $file ) );
$etag = '"' . md5( $last_modified ) . '"';
header( "Last-Modified: $last_modified GMT" );
header( 'ETag: ' . $etag );
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + 100000000 ) . ' GMT' );

// Support for Conditional GET
$client_etag = isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ? stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) : false;

if( ! isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) )
	$_SERVER['HTTP_IF_MODIFIED_SINCE'] = false;

$client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
// If string is empty, return 0. If not, attempt to parse into a timestamp
$client_modified_timestamp = $client_last_modified ? strtotime( $client_last_modified ) : 0;

// Make a timestamp for our most recent modification...
$modified_timestamp = strtotime($last_modified);

if ( ( $client_last_modified && $client_etag )
	? ( ( $client_modified_timestamp >= $modified_timestamp) && ( $client_etag == $etag ) )
	: ( ( $client_modified_timestamp >= $modified_timestamp) || ( $client_etag == $etag ) )
	) {
	status_header( 304 );
	exit;
}

readfile( $file );

Now connect to your website using an FTP client. Once connected, upload the file you just created to /wp-contents/uploads/ folder on your website.

Next, you need edit the .htaccess file in your website’s root folder. Add the following code at the bottom of your .htaccess file:

RewriteCond %{REQUEST_FILENAME} -s
RewriteRule ^wp-content/uploads/(.*)$ download-file.php?file=$1 [QSA,L]

Don’t forget to save your changes and upload the file back to your website.

Now all user requests to your media folder will be sent to a proxy script to check for authentication and redirect users to login page.

4. Adding Forms to Your WordPress Intranet with WPForms

WPForms

The main goal of a company intranet is communication. BuddyPress does a great job with activity streams, comments, and private messaging.

However, sometimes you’ll need to collect information privately in a poll or survey. You’ll also need to sort and store that information for later use.

This is where WPForms comes in. It is the best WordPress form builder in the market.

Not only it allows you to easily create beautiful forms, it also saves user responses in the database. You can export responses for any form into a CSV file.

This allows you to organize form responses in spreadsheets, print them, and share among your colleagues.

Extending Your WordPress Intranet

By now you should have a perfectly capable intranet for your organization. However, as you test the platform or open it for users, you may want to add new features or make it more secure.

There are plenty of WordPress plugins that can help you do that. Here are some tools that you may want to add right away.

That’s all for now.

We hope this article helped you create a WordPress intranet for your organization. You may also want to see our list of most useful WordPress widgets for your site.

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 WordPress Intranet for Your Organization appeared first on WPBeginner.

How to Set a Default Fallback Image for WordPress Post Thumbnails

Often new bloggers forget to set a post thumbnail (featured image) which causes the template display to break. In this article, we will show you two different ways of adding a default fallback image for WordPress Post Thumbnails.

The post How to Set a Default Fallback Image for WordPress Post Thumbnails appeared first on WPBeginner.

Do you want to set a default fallback image for WordPress post thumbnails? Featured images also known as post thumbnails are very useful in engaging users and making your articles more noticeable on social media. In this article, we will show you how to set a default fallback image for WordPress post thumbnails.

Fallback image for post thumbnails in WordPress

Why You Need a Default Fallback WordPress Post Thumbnail?

Post thumbnails or featured images is a WordPress theme feature which allows you to associate an image with your blog post or article. Depending on your theme, this image is then used on homepage, archives, or sidebar widgets.

Some WordPress themes display post thumbnail and excerpt of an article on the homepage in a grid layout. If you forget to add a post thumbnail for an article, then it will appear without a thumbnail, and your layout will look broken.

Layout broken without post thumbnail

By adding a fallback image, you can set a branded image to be used when no post thumbnail is found. This allows you to make sure that all your articles have a post thumbnail.

Another way to deal with this problem is using the Require Featured Image plugin. It makes it mandatory for all authors to add a featured image to their articles before publishing.

Having said that, let’s take a look at how to easily set a default fallback image for WordPress post thumbnails.

Method 1: Set Default Fallback Image for Post Thumbnails Using Plugin

This method is easier and recommended for all users.

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

Upon activation, you need to visit the Settings » Media page to configure plugin settings.

Default featured image settings

On this page, you need click on the ‘Select default featured image’ button to upload or select the image you would like to use as your fallback post thumbnail.

Don’t forget to click on the save changes button after selecting your featured image.

You can now visit your website to see it in action. The plugin will automatically start showing your default fallback image as post thumbnail for articles that do not have a featured image set.

Method 2: Add Fallback Image as Post Thumbnail Manually

This method requires you to add code to your WordPress theme files. If you haven’t done this before, then please take a look at our guide on how to copy and paste code in WordPress.

First, you need to create an image that you want to use as the default image. Next, you need to upload it to your theme’s images folder using a FTP client.

Your theme’s images folder is located inside /wp-content/themes/yur-theme/ folder. If it doesn’t have the images folder, then you need to create it.

After you have uploaded the image to your website, the next step is to tell WordPress to look for this image when a post doesn’t have its own post thumbnail.

Your WordPress theme displays post thumbnails in various places. You need to look for the_post_thumbnail() function in theme files. Typically, you’ll find it in archive.php, single.php, or content templates.

Next, you need to add the following code where you want to display post thumbnail.

<?php if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else { ?>
<img src="<?php bloginfo('template_directory'); ?>/images/default-image.jpg" alt="<?php the_title(); ?>" />
<?php } ?>

Don’t forget to replace default-image.jpg with your own image file name.

That’s all, you can now visit your website to see it in action.

Fallback thumbnail

Method 3: Use First Image in an Article as Post Thumbnail

This method also requires you to add code to your WordPress theme files.

First, you need to add this code to your theme’s functions.php file or a site-specific plugin.

//function to call first uploaded image in functions file
function main_image() {
$files = get_children('post_parent='.get_the_ID().'&post_type=attachment
&post_mime_type=image&order=desc');
  if($files) :
    $keys = array_reverse(array_keys($files));
    $j=0;
    $num = $keys[$j];
    $image=wp_get_attachment_image($num, 'large', true);
    $imagepieces = explode('"', $image);
    $imagepath = $imagepieces[1];
    $main=wp_get_attachment_url($num);
        $template=get_template_directory();
        $the_title=get_the_title();
    print "<img src='$main' alt='$the_title' class='frame' />";
  endif;
}

This code simply outputs the first image added to an article. Now we need to display this output in your theme.

To do that, you will need to edit the theme files where post_thumbnail(); function is used. Replace it with the following code.

<?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) {
  echo get_the_post_thumbnail($post->ID);
} else {
   echo main_image();
} ?>

Using first image as the post thumbnail in WordPress

You can now visit your website to see it in action.

We hope this article helped you set default fallback image for WordPress post thumbnails. You may also want to see best featured image plugins and tutorials for WordPress.

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

The post How to Set a Default Fallback Image for WordPress Post Thumbnails appeared first on WPBeginner.

Referencing .NET Standard Assemblies from both .NET Core and .NET Framework

Lots of .NET Projects sharing a .NET Standard LibraryI like getting great questions in email but I LOVE getting great questions in email with a complete and clear code repro (reproduction) that’s in a git somewhere. Then I can just clone, build (many many bonus points for a clean build) and check out the bug.

I got a great .NET Core question and repro here https://github.com/ScarlettCode/Example. I forked it, fixed it, and submitted a PR. Here’s the question and issue and today’s fix.

The project has a C# library project (an assembly) that is written to the .NET Standard 2.0. You’ll recall that the .NET Standard isn’t a runtime or a library in itself, but rather an interface. They are saying that this library will work anywhere that the .NET Standard is supported, like Linux, Mac, and Windows.

Here’s that main .NET Standard Library called “Example.Data” written in C#.

Then he had:

  • Windows Forms (WinForms) application in VB.NET using .NET “full” Framework 4.6
  • Console Application also using .NET Framework 4.6
  • Console Application using .NET Core 2.0

Each of these apps is referring to the Example.Data library. The Example.Data library then pulls in a database access library in the form of Microsoft.EntityFrameworkCore.InMemory via NuGet.

WinForms app -> Data Access library -> Some other library. A->B->C where B and C are packages from NuGet.

The .NET Core console builds and runs great. However, when the other projects are run you get this error:

Can't load
Could not load file or assembly
'Microsoft.EntityFrameworkCore, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=adb9793829ddae60'
or one of its dependencies. The system cannot find
the file specified.

Pretty low level error, right? First thing is to check the bin folder (the results of the compile) for a project that doesn’t run. Looks like there’s no Microsoft.EntityFrameworkCore there. Why not? It’s assembly “C” downstream of “A” and “B”. EntityFramework’s assembly is referred to by the Example.Data assembly…but why didn’t it get copied in?

The “full” Framework projects are using the older .csproj format and by default, they use package.config to manage dependencies. The newer projects can reference Packages as first-class references. So we need to tell ALL projects in this solution to manage and restore their packages as “PackageReferences.”

I can open up the .csproj file for the Framework projects and add this line within the first <PropertyGroup> like this to change the restore style:

 <RestoreProjectStyle>PackageReference</RestoreProjectStyle>

As Oren wisely says:

“Using .NET Standard requires you to use PackageReference to eliminate the pain of “lots of packagesâ€� as well as properly handle transitive dependencies. While you may be able to use .NET Standard without PackageReference, I wouldn’t recommend it.”

I can also change the default within VS’s Package Management options here in this dialog.

 <RestoreProjectStyle>PackageReference</RestoreProjectStyle> Default Package management format

Hope this helps.


© 2017 Scott Hanselman. All rights reserved.
     

Lots of .NET Projects sharing a .NET Standard LibraryI like getting great questions in email but I LOVE getting great questions in email with a complete and clear code repro (reproduction) that's in a git somewhere. Then I can just clone, build (many many bonus points for a clean build) and check out the bug.

I got a great .NET Core question and repro here https://github.com/ScarlettCode/Example. I forked it, fixed it, and submitted a PR. Here's the question and issue and today's fix.

The project has a C# library project (an assembly) that is written to the .NET Standard 2.0. You'll recall that the .NET Standard isn't a runtime or a library in itself, but rather an interface. They are saying that this library will work anywhere that the .NET Standard is supported, like Linux, Mac, and Windows.

Here's that main .NET Standard Library called "Example.Data" written in C#.

Then he had:

  • Windows Forms (WinForms) application in VB.NET using .NET "full" Framework 4.6
  • Console Application also using .NET Framework 4.6
  • Console Application using .NET Core 2.0

Each of these apps is referring to the Example.Data library. The Example.Data library then pulls in a database access library in the form of Microsoft.EntityFrameworkCore.InMemory via NuGet.

WinForms app -> Data Access library -> Some other library. A->B->C where B and C are packages from NuGet.

The .NET Core console builds and runs great. However, when the other projects are run you get this error:

Can't load

Could not load file or assembly
'Microsoft.EntityFrameworkCore, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=adb9793829ddae60'
or one of its dependencies. The system cannot find
the file specified.

Pretty low level error, right? First thing is to check the bin folder (the results of the compile) for a project that doesn't run. Looks like there's no Microsoft.EntityFrameworkCore there. Why not? It's assembly "C" downstream of "A" and "B". EntityFramework's assembly is referred to by the Example.Data assembly...but why didn't it get copied in?

The "full" Framework projects are using the older .csproj format and by default, they use package.config to manage dependencies. The newer projects can reference Packages as first-class references. So we need to tell ALL projects in this solution to manage and restore their packages as "PackageReferences."

I can open up the .csproj file for the Framework projects and add this line within the first <PropertyGroup> like this to change the restore style:

 <RestoreProjectStyle>PackageReference</RestoreProjectStyle>

As Oren wisely says:

"Using .NET Standard requires you to use PackageReference to eliminate the pain of “lots of packages� as well as properly handle transitive dependencies. While you may be able to use .NET Standard without PackageReference, I wouldn’t recommend it."

I can also change the default within VS's Package Management options here in this dialog.

 <RestoreProjectStyle>PackageReference</RestoreProjectStyle> Default Package management format

Hope this helps.



© 2017 Scott Hanselman. All rights reserved.