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.
     

7 Best WordPress RSVP Plugins for Your Website

Are you looking for an RSVP plugin for WordPress? RSVP plugins allow you to accept responses to your invitations directly on your website, so you can better manage your events. In this article, we have hand-picked some of the best RSVP plugins for WordPress that… Read More »

The post 7 Best WordPress RSVP Plugins for Your Website appeared first on WPBeginner.

Are you looking for an RSVP plugin for WordPress? RSVP plugins allow you to accept responses to your invitations directly on your website, so you can better manage your events. In this article, we have hand-picked some of the best RSVP plugins for WordPress that will make your event management easier.

RSVP Plugins for WordPress

Why and When You Need a WordPress RSVP Plugin

Managing events can be a lot of hassle. That’s why most professional event managers will tell you to automate tasks, so you can focus on making your event successful.

Waiting for RSVP responses and then compiling them manually is one such task that you can automate. A WordPress RSVP plugin can help you do that and more.

It will let guests confirm their attendance and compile a list of guests for you. Some WordPress plugins will even allow you to export entries into other formats and use the data for email marketing.

That being said, let’s take a look at some of the best WordPress RSVP plugins for your events.

1. WPForms

WPForms

WPForms is the best WordPress form builder in the market. It allows you to create beautiful forms by using a simple drag and drop interface.

WPForms stores all form entries in your WordPress database, and you can export them in CSV format. This allows you to easily add a RSVP form to your website and let your guests fill in their information.

Creating an RSVP form with WPForms

WPForms also gives you the freedom to collect extra information that you may you need from your guests. You can also integrate the form to your email list and even accept payments using Stripe or PayPal.

For detailed instructions, check out how to create an RSVP form in WordPress.

2. Event Tickets

Event Tickets

Event Tickets allows you to create event tickets in WordPress and add them to your posts or pages. You can simply add tickets and RSVP option to any WordPress post or page. Simply select the dates for your events and let your guests fill in the form.

The downside is that you will not be able to add any additional fields to the form. If you wanted to sell tickets and accept payments, then you’ll need to set up The Events Calendar plugin with a separate WordPress ecommerce plugin.

3. RSVP and Event Management

RSVP and Event Management

RSVP and Event Management plugin offers a powerful event management platform for WordPress websites. This also includes a complete RSVP system.

You can make events restricted by adding a passcode to RSVP forms. You can also create RSVP forms that do not require passcode, so anyone can join in. It can send email notifications, allow attendees to add friends / family, and you can even add custom questions to the RSVP form.

The premium version of plugin allows you to run multiple events and send mass emails to attendees.

4. RSVPMaker

RSVPMaker

RSVPMaker is an event scheduling and RSVP tracking plugin for WordPress. It allows you to add events anywhere on your WordPress site, so your guests can RSVP.

You can require your guests to register on WordPress, create custom questions, integrate guests list with MailChimp, and accept payments through PayPal. It can also be used to create a custom events calendar.

5. Events Made Easy

Events Made Easy

Events Made Easy is a simple yet powerful WordPress events and RSVP plugin. It allows you to manage events from your WordPress site with RSVP form and attendee management features.

Events Made Easy works with Google Calendar, Google Maps, and can also be synced with your Facebook Events through an addon plugin. You can also make an event recurring which will allow you to automatically manage the event through each cycle. This feature is particularly useful if you run meetups, classes, or support groups.

It is also translation ready and can be fully localized which makes it a great choice for multilingual websites.

6. Meetup Widgets

Meetup Widgets

Meetup.com is a popular platform used by millions of online communities to organize regular meetups and events. If you run a meetup.com group, then you can easily publicize meetups on your WordPress site.

This allows you to use Meetup.com’s event management tools including RSVP feature on your website. The disadvantage of using the widget is that your guests will be providing all the information to meetup.com, and you will not be able to make tweaks to the information it collects.

For detailed instructions, see our guide on how to connect WordPress to your meetup.com group.

7. Simple Calendar

Simple Calendar

Simple Calendar allows you to easily add your Google Calendar events in WordPress. Google Calendar comes with powerful event management feature which allows you to invite up to 2,000 guests to an event.

You can use your website to publicize an event by adding the Google Calendar to your website. This calendar can be used for one-time or recurring events, birthdays, parties, and more.

You can make an event public and allow anyone to see the details. If you keep an event limited to the invited guests, then you can invite them by adding their email address. Your guests will be able to RSVP in their Google Calendar app or by simply clicking on the RSVP links. You can see your guests list inside Google calendar.

Downside of using Google Calendar is that you cannot create custom forms, ask for information, integrate email list, or accept payments.

That’s all for now.

We hope this article helped you find the best WordPress RSVP plugin for your events. 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 7 Best WordPress RSVP Plugins for Your Website appeared first on WPBeginner.

25 Best WordPress Themes for Financial Sites

Are you a financial planner or business consultant who’s looking to make a website with WordPress? Want to know which are the best WordPress themes for financial sites? In this article, we have hand-picked some of the best WordPress themes for financial sites like accountants,… Read More »

The post 25 Best WordPress Themes for Financial Sites appeared first on WPBeginner.

Are you a financial planner or business consultant who’s looking to make a website with WordPress? Want to know which are the best WordPress themes for financial sites? In this article, we have hand-picked some of the best WordPress themes for financial sites like accountants, financial advisors, consultants, and management firms.

Best WordPress themes for financial sites

Building a Financial Website with WordPress

WordPress is the most popular platform to build any kind of website. It is already been used by big name brands, popular universities, and thousands of small businesses.

To start a WordPress site, the first thing you need to make sure is that you choose the right WordPress version. Yes, there are two of them. We recommend using the self-hosted WordPress.org because it offers more flexibility and features. See: WordPress.com vs WordPress.org (full comparison).

You will need a domain name, your website’s address, and a WordPress hosting account where your files are going to be stored.

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

Bluehost has agreed to offer an exclusive deal to WPBeginner users. It will get you a free domain, SSL certificate, and 60% discount on hosting. Click here to start with Bluehost.

After purchasing a hosting account, you are now ready to install WordPress. Follow the instructions in our how to start a WordPress blog, and you’ll be ready to launch your website in no time.

Now that you have your website setup, let’s take a look at some of the best WordPress themes for financial sites that you can use on your website.

1. Leader

Leader

Leader is a powerful multi-purpose WordPress theme for financial and business websites. It comes with multiple homepage designs to choose from. You can also customize each design as much as you like.

It has many styles for headers, navigation menus, blog page, and more. It ships freebies like a premium drag and drop page builder, and a responsive WordPress slider plugin. For theme setup, it has a powerful theme options panel that helps you setup your website quickly.

2. Enterprise

Enterprise

Enterprise is designed from scratch for corporate, business, and financial websites. It is a powerful WordPress theme with an easy to use theme options panel.

It includes services, team members, knowledge base, support, and partners sections. You can also add animated statistics with graphs and charts, pricing tables, and more. It also has a section to add a support and knowledgebase section to offer customer support directly from your website.

3. Firstrise

Firstrise

Firstrise is a WordPress theme for financial, accounting, and consultant websites. It has two ready to use homepage layouts and ships with a page builder plugin to create your own layouts if needed.

Other notable features include parallax background support, sticky navigation menu, multiple sidebars and page templates. It can be used to create multilingual websites using WPML.

4. Potenza

Potenza

Potenza is a modern WordPress theme designed for financial, accounting, taxation, and consultancy websites. It features a drag and drop widgetized homepage layout. Simply fill in content widgets to setup your homepage.

It has customization features lik custom background, images, CSS animations, and parallax modules. It also comes with several custom widgets for social sharing and content discovery features.

5. Rare

Rare

If you are looking for a beautiful yet highly customizable theme, then checkout Rare. It is designed to flexible and comes with tons of options like multiple homepage styles, custom logo support, sidebar placements, sliders, and more.

It ships with a page builder plugin with tons of custom modules. It also has beautiful templates for photo galleries and portfolio items. It can also be used to start an online store using WooCommerce.

6. Atmosphere Pro

Atmosphere Pro

Atmosphere Pro is built on top of powerful Genesis framework. It is a flexible WordPress theme featuring a minimalist approach to design. It has a fully widgetized homepage, which allows you to just drag and drop widgets to setup homepage.

Inside you will find an easy to use theme options panel to configure general website options. It also supports live theme customizer, which allows you to see changes as you setup theme. It is also eCommerce ready for full WooCommerce support and templates for shop and product pages.

7. Ampersand

Ampersand

Ampersand is a beautifully crafted WordPress theme for business websites. The main features include beautiful typography, subtle colors, and gorgeous image galleries. It has an easy to setup homepage layout and a built-in portfolio section.

It is super easy to use and comes with only the options you’ll need. It has custom header images, a single navigation menu on top, a social profiles menu at the bottom, a blog section with sidebar.

8. Montblanc

Montblanc

Montblanc is a modern and stylish WordPress theme suitable for financial sites. The homepage features a fullscreen slider with call to action. It has portfolio, team members, partners, and testimonials sections.

It has 5 homepage layouts, multiple page templates, and WooCommerce support with beautiful templates for shop and product pages. It also has a built-in contact form page, blog section, shortcodes, and social media features.

9. Presence

Presence

Presence is a modern WordPress theme suitable for financial, accounting, and wealth management related firms. It comes with 10 website demos that you can install with 1-click and then just replace the content and images with your own. It has social icons, Google fonts, and live theme customizer suport.

It comes in 6 color schemes, with multiple slider, custom headers, and layouts. Theme customization is quite straight forward and you will be able to get up and running without struggling with settings. It is also WooCommerce ready, works with any page builder plugin, and also supports WPML for multilingual websites.

10. Executive Pro

Executive Pro

If you are looking for a corporate look, then check out Executive Pro. Created by StudioPress and built for Genesis theme framework, Executive Pro has a powerful code base with an elegant design.

It has a widgetized homepage layout featuring a slider on top. Followed by your most important pages and a call to action banner. It has multiple page templates, custom widgets, and WooCommerce support. It also has a landing page template that you can use with a page builder plugin like Beaver Builder to create landing pages.

11. Highend

Highend

Highend is a powerful WordPress business theme with beautiful design and tons of styles. It ships with 16+ demo templates, which are complete websites that you can install with 1-click. Other freebies included are premium page builder, sliders, and grid plugins.

This WooCommerce ready theme has multiple page templates, unlimited colors, icon fonts, social media integration, and full bbPress support. It has a powerful options panel to change theme settings and it is also translation ready with multilingual support.

12. The Core

The Core

The Core is a versatile WordPress theme with 20 ready made websites packed inside one theme. These websites include templates for different types of businesses including corporate, financial, and accounting websites. You can install a complete demo with 1-click to instantly setup your website.

It has an integrated page builder to create your own landing pages with simple drag and drop tools. Each template is available in multiple color schemes, page templates, shortcodes, portfolio, Google Maps, and beautiful BuddyPress templates.

13. Beyond

Beyond

Beyond is a creative WordPress theme for accounting, agencies, and financial sites. This powerful theme is packed with customization options and ships with free page builder and slider plugins.

It has boxed and full-width layouts with different sidebar and sticky navigation menu placements. It has light box popups for galleries and videos, unlimited colors, Google fonts, columns and grids, progress bar, animations, and more. Theme settings are controlled with a powerful custom options panel with live theme customizer support.

14. Parallax

Parallax

Parallax is a stunningly gorgeous WordPress theme featuring a modern elegant design. It is designed to be a one page theme, but can also be used as a multi-page website. The homepage has a fullscreen slider on top followed by your navigation menu, services, contact form, and social media sections.

It offers an engaging user experience with beautiful animations, parallax effects, animated bars, call to action buttons, and vertical navigation. It has an integrated page builder with 11 header and layout styles. Blog pages can be setup in grid layouts with or without featured images. It is WooCommerce ready and comes with an easy to use theme options panel.

15. OceanWP

OceanWP

If you are looking for highly customizable but free WordPress theme, then you’ll love OceanWP. This multipurpose WordPress theme offers tons of customization options and you can change layout for each page.

It also works well with all popular page builder plugins including free ones. All theme options can be easily setup in live customizer with unlimited colors, multiple layouts, 2 navigation menus in header, and header and footer styles.

16. Materialism

Materialism

If you are looking for a modern and colorful look for your financial website, then take a look at Materialism. It has built-in engagement options like call to action buttons, promo block, subscription, contact form, pricing tables, and more. It has two homepage styles and 4 different page templates that you can use throughout your website.

Other features include social media integration, testimonials, email signup form, and tons of customization options. It is easier to setup and all theme options are neatly organized in a custom theme dashboard.

17. Bento

Bento

Bento is a powerful and highly customizable free WordPress theme. It offers a premium grade design and flexible features neatly organized into live theme customizer. Upon activation, it recommends installing free page builder plugin, which adds drag and drop functionality to the theme.

It comes with multiple layout choices, sidebar and header styles, Google Fonts, author bio box, and more. It also allows you to change page layouts for single posts and pages directly from post editor screen.

18. Koehn

Koehn

Koehn is a beautifully designed WordPress theme suitable for architects, accountants, and financial websites. It has a minimal but well thought design featuring a fullscreen slider on the homepage.

It has a drag and drop homepage layout and custom widgets for content and social media integration. Inside you’ll also find a portfolio section, unlimited color choices, and multiple widget ready areas. It is also translation ready and supports all page builder plugins.

19. Ultra

Ultra

Ultra is a powerhouse of a WordPress theme designed to be easily used for any kind of website. It comes with 9 readymade demos with 1-click installer and 60+ pre-designed layouts for landing pages. It also has an integrated page builder with drag and drop modules to quickly build your own pages.

Other features include 15 header and page styles, 5 blog post layouts, 6 types of header backgrounds, preset colors and beautiful typography.

20. Unik

Unik

Unik is another beautiful WordPress theme for financial and business websites. It has a modern design with lots of easy to use features. The homepage features beautiful parallax effects, smooth animations, lazy loading for images, and drag and drop sections.

Other notable features include beautiful blog styles, portfolio section, services section, different page styles, and sidebars. It ships with page builder and slider plugins and is fully compatible with multilingual plugins.

21. Venture

Venture

If you are looking for a modern but simple WordPress theme for financial websites, then take a look at Venture. This beautiful WordPress theme comes with a simple theme options panel and live visual customizer. It is quick and easy to setup with drag and drop content widgets.

It also comes with 1-click demo content installer and full WooCommerce support. You can easily change text, background, and link colors, add slider, change header styles, and more. It also has a sub-pages widget that automatically displays sub-pages of a parent page with excerpts and featured images.

22. Narcos

Narcos

Narcos is a modern and stylish WordPress theme designed for any kind of business, financial, or personal website. It is very flexible in terms of features and layouts. The homepage features a beautiful slider at top with transparent menu and logo support.

It has partners, services, about us, testimonials, portfolio, and team members sections. You can also show recent blog posts with a parallax background and beautiful animations. It is easy to setup and comes with a custom theme options panel to help you get started.

23. Spark

Spark

Spark is a beautifully designed and well coded WordPress multipurpose theme. It supports both boxed and fullwidth layouts with multiple header and layout styles to choose from. It ships with premium slider and page builder plugin with dozens of custom modules that you can add to your pages.

It has sections for portfolio, team members, and knowledge base articles. Other notable features include Twitter widget, icon fonts, Google maps, icon fonts, and a powerful theme options panel.

24. Nayma

Nayma

Nayma is a modular WordPress theme for business websites featuring a drag drop page builder with easy to add modules. It comes with 8 readymade website demos with 1-click installer and a super easy theme options panel.

Inside you will also find custom font upload, custom logo, icon fonts, unlimited sidebars, featured content slider, and more. Nayma also has portfolio section, photo galleries, WooCommerce and WPML support.

25. Edge

Edge

Edge is another clean and stylish WordPress theme suitable for financial, accounting, and business websites. This multipurpose WordPress theme comes with multiple homepage styles, layout choices, and visual page builder plugin.

Inside you will also find custom widgets, social media integration, business hours, fullscreen video background, portfolio, and staff profiles sections. It is easy to use and has a custom theme options dashboard to help you setup your website.

We hope this article helped you find the best WordPress theme for financial sites. 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 25 Best WordPress Themes for Financial Sites appeared first on WPBeginner.

Draft – .NET Glossary Diagram

I’m working on this slide as support for this excellent .NET Glossary. It’s not done yet, but I’m curious for your thoughts. Every system has terms and concepts that are initially unfamiliar but make sense once you grok them.

image

Here are these concepts used in an example sentence, for context:

  • Application Framework – “Are you using the ASP.NET Core web framework for that microservice?â€�
  • Metapackage – “I want to install the ASP.NET Core framework; it’s a package of packagesâ€�
  • Package/NuGet – “I know there’s a NuGet package for decoding JSON.â€�
  • Library/Assembly – “Now, you’ll compile your source into an assemblyâ€�
  • .NET Standard – “Which version of the .NET Standard specification does your assembly target?”
    • “My Apple Watch supports .NET Standard 1.6 but my Windows 10 laptop supports 2.0 with more APIs.â€�
  • C#, F#, VB, etc – “Which language did you use?â€�
  • .NET SDK – “Did you get the developer tools?â€�
  • CLR/CoreCLR – “Which runtime is your app using?â€�
  • An implementation of .NET is a runtime along with libraries that implement a version of the .NET Standard
    • “Are you using .NET Core, .NET Framework, or Mono for this project?â€�
  • Platform – An operating system and some hardware (ARM, x64, etc.)
    • “Is that an ASP.NET Core app running in Docker on a Raspberry Pi?â€�

Constructive feedback, please. This is a draft.


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.
     

I'm working on this slide as support for this excellent .NET Glossary. It's not done yet, but I'm curious for your thoughts. Every system has terms and concepts that are initially unfamiliar but make sense once you grok them.

image

Here are these concepts used in an example sentence, for context:

  • Application Framework - “Are you using the ASP.NET Core web framework for that microservice?â€�
  • Metapackage - “I want to install the ASP.NET Core framework; it’s a package of packagesâ€�
  • Package/NuGet - “I know there’s a NuGet package for decoding JSON.â€�
  • Library/Assembly - “Now, you’ll compile your source into an assemblyâ€�
  • .NET Standard – “Which version of the .NET Standard specification does your assembly target?"
    • "My Apple Watch supports .NET Standard 1.6 but my Windows 10 laptop supports 2.0 with more APIs.â€�
  • C#, F#, VB, etc – “Which language did you use?â€�
  • .NET SDK - “Did you get the developer tools?â€�
  • CLR/CoreCLR – “Which runtime is your app using?â€�
  • An implementation of .NET is a runtime along with libraries that implement a version of the .NET Standard
    • “Are you using .NET Core, .NET Framework, or Mono for this project?â€�
  • Platform - An operating system and some hardware (ARM, x64, etc.)
    • “Is that an ASP.NET Core app running in Docker on a Raspberry Pi?â€�

Constructive feedback, please. This is a draft.


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.
     

How to Automatically Link Keywords with Affiliate Links in WordPress

Many content publishers use affiliate marketing to make money online. The problem is that sometimes you may forget to add affiliates links in your article thus leaving money on the table. Luckily, there’s an easy solution to recover that revenue. In this article, we will… Read More »

The post How to Automatically Link Keywords with Affiliate Links in WordPress appeared first on WPBeginner.

Many content publishers use affiliate marketing to make money online. The problem is that sometimes you may forget to add affiliates links in your article thus leaving money on the table. Luckily, there’s an easy solution to recover that revenue. In this article, we will show you how to automatically link keywords with affiliate links in WordPress.

Adding automatic links to keywords with affiliate links in WordPress

How does Automatic Affiliate Links work in WordPress?

Automatic affiliate link plugins allow you to convert specific keywords or brand mentions into affiliate links. This helps you unlock more revenue from your existing blog posts.

Every now and again sometimes you will forget to add affiliate links into your articles. This problem gets even bigger when you have a multi-author blog.

Auto affiliate link plugins fix that problem and help you maximize your earning.

Another advantage of automatic affiliate linking is that it will also add links to your older articles where a specific keyword is mentioned. This allows you to not just monetize your new content, but also take advantage of your older articles.

We have been using automatic affiliate linking on WPBeginner since 2009 to automatically replace brand mentions into affiliate links.

Let’s take a look at how to easily setup automatic affiliate link solution on your WordPress site.

Method 1: Automatically link Keywords in WordPress with ThirstyAffiliates

ThirstyAffiliates is the best affiliate link manager plugin in the market. We use it on our own websites including WPBeginner.

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

Upon activation, you need to visit the ThirstyAffiliates » Addons page and scroll down to Autolinker addon section. Next, click on the ‘Go to add-on page’ button to continue.

Autolinker addon

This will take you to the ThirstyAffiliates website. Autolinker is a paid addon, and it costs $49 dollars. You will likely recover this investment in the first month if you set it up properly.

After making the purchase you will be able to download the addon. Next, you need to install the Autolinker addon like you would install any other WordPress plugin.

Upon activation, head over to Affiliate Links » Settings page and scroll down to the Autolinker section.

Autolinker settings

First you need to provide the license key for the Autolinker addon. You can obtain this information from your account on ThirstyAffiliates website.

Next, you need to enter the email address used to purchase the addon. Below that, you will see options to enable or disable autolinking on certain pages like homepage, archives, and heading tags. You can also enable auto-linking for custom post types and bbPress forum threads.

On the WPBeginner site, we have autolinking disabled for headings, archive pages, and home page. Mainly because its too obtrusive in our opinion.

We definitely recommend enabling the Random Autolink Placement option because it makes your affiliate links look more natural. If you have this option disabled, then Autolinker will just link the first keyword it finds. While this isn’t bad if you’re only replacing each brand mention or keyword once, but it looks extremely bad when you have the replacement frequency higher than 1 (more on this topic later in the article).

We also recommend that you enable autolinking in your RSS feeds. This will help you maximize your earnings from readers who only read your website via RSS readers. Another advantage is that this lets you make money from people who’re scraping / stealing content from your site.

Since most scraping scripts steal the article from your RSS feed, these articles will contain your affiliate links. Since we started our blog in 2009, we have made thousands of dollars from sites that steal our content by using this technique.

Once you have configured your settings, don’t forget to click on the save settings button to store your changes.

You are now ready to add affiliate links. Go to the Affiliate Links » Add New page to add your first affiliate link.

Adding affiliate links in WordPress with ThirstyAffiliates

You will need to provide a link name and the destination URL. After that, scroll down to the autolinking section and add keywords that you want to be automatically linked.

You can add multiple keywords separated by comma. You can also set a limit on how many times a keyword can be linked in an article.

Add keywords you want to be automatically linked

In most cases, we recommend the Limit of 1 link per keyword. In the past, we used to have 3 links per keyword, but it gets really crowded as your site grows and you have hundreds of affiliate links.

Don’t forget to click on the ‘Save link’ button to add your affiliate link.

Now every time these keywords appear in an article, they will be automatically linked with the affiliate link you added above.

For detailed instructions, see our guide on how to add affiliate links in WordPress with ThirstyAffiliates.

Method 2: Auto Link Keywords with Affiliate Links using Pretty Link Pro

Pretty Link Pro is another great affiliate link manager and URL shortener plugin for WordPress. It allows you to easily manage your links in WordPress and use the auto-linking feature to automatically add affiliate links in your blog posts.

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

Upon activation, go to Pretty Link » Activate Pro page to enter your license key. You can find this information from your account on the Pretty Link Pro website.

Activate license

Next, head over to the Pretty Link » Add New Link page to add your affiliate links.

Add new affiliate link

First you need to select a redirection type. You need to use 301 permanent for all affiliate links.

After that, you need to add the target URL, and the URL you want to use as the shortened or cloaked URL.

You also need to add a name for the link in the title field, and any notes that you want to add for the link.

Now you need to click on the ‘Pro Options’ tab to expand it and add the keywords you want to be automatically linked. You can add multiple keywords separated by commas.

Auto link keywords

Don’t forget to click on the create button to save your link. After you save the link, these keywords will be automatically linked in all your posts.

You still need to control how you want automatic links to be added into your articles. You can do this by going to the Pretty Link » Options page and click on the ‘Replacements’ tab.

Auto link options

On this screen, you can enable the replacements as well as set an auto-link threshold which allows you to limit how many times a keyword will be linked in an article.

You can also set the links to open in a new window and make sure to check the nofollow option.

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

Pretty Link Pro is a powerful plugin with tons of options for features like URL shortening, redirection, and affiliate link management. Feel free to explore these options and change them if you need.

We hope this article helped you learn how to automatically link keywords with affiliate links in WordPress. You may also want to see our full list of best affiliate marketing tools and plugins 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 Automatically Link Keywords with Affiliate Links in WordPress appeared first on WPBeginner.

How Much Does a Custom WordPress Theme Cost?

After writing our article on how much does it cost to build a WordPress site, several readers asked us to expand on the custom website cost section. If you’re wondering how much does a custom WordPress theme cost, then you’re in the right place. In… Read More »

The post How Much Does a Custom WordPress Theme Cost? appeared first on WPBeginner.

After writing our article on how much does it cost to build a WordPress site, several readers asked us to expand on the custom website cost section. If you’re wondering how much does a custom WordPress theme cost, then you’re in the right place. In this article, we will share how much does a custom WordPress theme cost as well as few tips on how you can save money and avoid overpaying.

Cost of a Custom WordPress Theme

What is a Custom WordPress Theme?

A custom WordPress theme has a unique design, layout, and set of features that are made specifically for your business needs.

Since there are thousands of free and premium WordPress themes available, a custom WordPress theme helps your company / brand stand out.

The benefit of getting a custom WordPress theme is that you’re not limited by the constraints of a pre-existing template or layout. You have full freedom to customize your website and get any specific functionality built within your theme.

Factors that Affect the Cost of a Custom WordPress Theme

Since each custom WordPress theme is built specifically for the individual client, the cost of the project varies based on the requirements. Below are some of the factors that will impact the cost of your custom WordPress theme:

Individual Freelancer vs Agency

To create a custom WordPress theme, you will need someone who can design (designer) and code your theme (developer).

Depending on your needs, you may be able to find an individual who can do both design and develop the site, but remember it’s hard find a person who’s excellent at both design and code.

When you go with a full-service agency, it’s a one-stop shop because they have designers and developers in their team. This is also the reason why sometimes agencies can be more expensive.

Alternatively, you can hire an individual freelance designer and developer separately and mange the project yourself.

Experience and Expertise

Design and development is a creative process, so the project cost vary based on expertise, experience in the field, and creativity.

Well reputed WordPress development agencies may cost more than an individual developer or freelancer. However, a well known WordPress developer can sometimes charge even more than an agency.

Features, Functionality, and Expectations

Adding more features and functionality to your custom theme will increase the development time and cost. Normally, clients have higher expectations than their budget allows.

High quality work with custom features will take more time and hence it will cost more.

Change orders and Revisions

If you change the scope of your custom WordPress theme project in the middle of the process, then this can significantly increase your cost. While minor changes are ok, often freelancers and agencies will charge change-order fees for major change requests.

Hosting, Maintenance and Support

A custom WordPress theme does not include WordPress hosting, website maintenance or offering support after delivery of the project.

Some agencies and freelancers might offer these services at an additional cost.

How much a Custom WordPress Theme Actually Costs?

Cost estimates for a custom WordPress theme

Because there are several factors that affect the cost, it is extremely difficult to explain how much a custom WordPress theme cost in fixed numbers.

A typical custom WordPress theme for business or personal website theme could cost between $1,500 – $5,000.

A custom WordPress theme with additional built-in features or companion plugins can cost anywhere between $6,000 – $10,000.

If you have a complex enterprise level project, then is not uncommon for the prices to go above $30,000.

How to Avoid Overpaying for a Custom WordPress Theme?

Controlling cost of your custom WordPress theme project

With over a decade of experience in the WordPress industry, we have few tips that you can use to avoid overpaying for a custom WordPress theme.

Have a Clear Scope of the Project

When you’re building a house, you typically have a list of features that you want such as 4 bedrooms, 3 bathrooms, living room, etc.

You need to make a similar list for your website and list down all the things that you would like to have such as:

  • Editable home page with a testimonial slider and services list
  • Contact page with a contact form and a Google map with ability to find directions
  • Gallery area to showcase the work
  • Blog section with Social media share buttons

Having a detailed list makes it easier for someone to give you an accurate quote. It also helps limit revisions / change-order fees.

Find Live Website Examples for Inspiration when Possible

Going along with a detailed scope, having a list of inspirations really help with the design process.

You can have a list of websites and list out what you like about each of them.

This gives the designer a clear idea of what you’re looking for thus reduces the revisions and overall cost.

Use Premium Plugins vs Custom Built Functionality

Most reputable WordPress professionals will always choose a premium WordPress plugin vs build it out from scratch because it’s more efficient and saves cost.

However as a customer, we always recommend that you also do your research. Often the developer that you choose may have other suggestions, and it’s important that you understand why they decide to choose one plugin over another.

Customize Premium Themes vs Build from Scratch

One of the ways to significantly reduce cost while still getting a “custom” look and feel is to find an existing theme that has 90% of what you want.

While this cheats the custom theme concept, it can significantly reduce the overall cost.

Powerful drag and drop WordPress page builders like BeaverBuilder and Divi has given birth to an entirely new industry of “Website Assemblers”.

Professional website assemblers use existing WordPress plugins in combination with a drag & drop page builder to build you a custom-looking WordPress site at a much more affordable price.

How to Find the Right Developer or Agency for a Custom WordPress Theme

Finding developer for your custom WordPress theme

Due to its ease of use and low barrier of entry, there is a wide-range of people and companies offering custom WordPress theme services.

Finding a developer or agency with right experience and skill set can be a bit difficult. Specially because a lot of “website assemblers” also call themselves developers.

Here are some places where you can find experienced developers for your custom WordPress theme project.

Genesis DevelopersStudioPress, creators of the famous Genesis theme framework has a developers showcase where you can find experienced WordPress developers to work on your custom theme.

WPEngine Consultants – Managed WordPress hosting company, WPEngine, also has a dedicated page that lists experienced WordPress developers and agencies.

WPHired – This is a job board where you can post your WordPress jobs. Developers can then apply for the job, and you can discuss your project with them. You’ll have to look for developers with relevant experience and skills.

WordPress Jobs – Another WordPress specific job board where you can post jobs and interview developers.

Upwork – An online freelancing website where you can post your job and interview developers from all over the world. This would allow you to find developers with lower rates. It is an enormous community with designers and developers of varying skills and expertise.

Conclusion

A custom WordPress theme can make your website stand out with its unique design and custom features. However, not all beginners and small businesses can afford that right away.

If you are just starting out, then you can use a premium multipurpose theme and build your website at a fraction of a price.

Most modern themes have enough customization options that you can use to make them unique. Check out our showcase section where we regularly publish collection of themes for different industries and niches

However if you can afford a custom WordPress theme, then it is definitely worth the investment. Unique branding, custom design, and tailor made functionality will help you grow your business faster and give you an edge over your competitors.

We hope this article helped you understand how much does a custom WordPress theme cost and how you can avoid overpaying. You may also want to see our list of most notable big name brands using 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 Much Does a Custom WordPress Theme Cost? appeared first on WPBeginner.

How Much Does a Custom WordPress Theme Cost?

After writing our article on how much does it cost to build a WordPress site, several readers asked us to expand on the custom website cost section. If you’re wondering how much does a custom WordPress theme cost, then you’re in the right place. In… Read More »

The post How Much Does a Custom WordPress Theme Cost? appeared first on WPBeginner.

After writing our article on how much does it cost to build a WordPress site, several readers asked us to expand on the custom website cost section. If you’re wondering how much does a custom WordPress theme cost, then you’re in the right place. In this article, we will share how much does a custom WordPress theme cost as well as few tips on how you can save money and avoid overpaying.

Cost of a Custom WordPress Theme

What is a Custom WordPress Theme?

A custom WordPress theme has a unique design, layout, and set of features that are made specifically for your business needs.

Since there are thousands of free and premium WordPress themes available, a custom WordPress theme helps your company / brand stand out.

The benefit of getting a custom WordPress theme is that you’re not limited by the constraints of a pre-existing template or layout. You have full freedom to customize your website and get any specific functionality built within your theme.

Factors that Affect the Cost of a Custom WordPress Theme

Since each custom WordPress theme is built specifically for the individual client, the cost of the project varies based on the requirements. Below are some of the factors that will impact the cost of your custom WordPress theme:

Individual Freelancer vs Agency

To create a custom WordPress theme, you will need someone who can design (designer) and code your theme (developer).

Depending on your needs, you may be able to find an individual who can do both design and develop the site, but remember it’s hard find a person who’s excellent at both design and code.

When you go with a full-service agency, it’s a one-stop shop because they have designers and developers in their team. This is also the reason why sometimes agencies can be more expensive.

Alternatively, you can hire an individual freelance designer and developer separately and mange the project yourself.

Experience and Expertise

Design and development is a creative process, so the project cost vary based on expertise, experience in the field, and creativity.

Well reputed WordPress development agencies may cost more than an individual developer or freelancer. However, a well known WordPress developer can sometimes charge even more than an agency.

Features, Functionality, and Expectations

Adding more features and functionality to your custom theme will increase the development time and cost. Normally, clients have higher expectations than their budget allows.

High quality work with custom features will take more time and hence it will cost more.

Change orders and Revisions

If you change the scope of your custom WordPress theme project in the middle of the process, then this can significantly increase your cost. While minor changes are ok, often freelancers and agencies will charge change-order fees for major change requests.

Hosting, Maintenance and Support

A custom WordPress theme does not include WordPress hosting, website maintenance or offering support after delivery of the project.

Some agencies and freelancers might offer these services at an additional cost.

How much a Custom WordPress Theme Actually Costs?

Cost estimates for a custom WordPress theme

Because there are several factors that affect the cost, it is extremely difficult to explain how much a custom WordPress theme cost in fixed numbers.

A typical custom WordPress theme for business or personal website theme could cost between $1,500 – $5,000.

A custom WordPress theme with additional built-in features or companion plugins can cost anywhere between $6,000 – $10,000.

If you have a complex enterprise level project, then is not uncommon for the prices to go above $30,000.

How to Avoid Overpaying for a Custom WordPress Theme?

Controlling cost of your custom WordPress theme project

With over a decade of experience in the WordPress industry, we have few tips that you can use to avoid overpaying for a custom WordPress theme.

Have a Clear Scope of the Project

When you’re building a house, you typically have a list of features that you want such as 4 bedrooms, 3 bathrooms, living room, etc.

You need to make a similar list for your website and list down all the things that you would like to have such as:

  • Editable home page with a testimonial slider and services list
  • Contact page with a contact form and a Google map with ability to find directions
  • Gallery area to showcase the work
  • Blog section with Social media share buttons

Having a detailed list makes it easier for someone to give you an accurate quote. It also helps limit revisions / change-order fees.

Find Live Website Examples for Inspiration when Possible

Going along with a detailed scope, having a list of inspirations really help with the design process.

You can have a list of websites and list out what you like about each of them.

This gives the designer a clear idea of what you’re looking for thus reduces the revisions and overall cost.

Use Premium Plugins vs Custom Built Functionality

Most reputable WordPress professionals will always choose a premium WordPress plugin vs build it out from scratch because it’s more efficient and saves cost.

However as a customer, we always recommend that you also do your research. Often the developer that you choose may have other suggestions, and it’s important that you understand why they decide to choose one plugin over another.

Customize Premium Themes vs Build from Scratch

One of the ways to significantly reduce cost while still getting a “custom” look and feel is to find an existing theme that has 90% of what you want.

While this cheats the custom theme concept, it can significantly reduce the overall cost.

Powerful drag and drop WordPress page builders like BeaverBuilder and Divi has given birth to an entirely new industry of “Website Assemblers”.

Professional website assemblers use existing WordPress plugins in combination with a drag & drop page builder to build you a custom-looking WordPress site at a much more affordable price.

How to Find the Right Developer or Agency for a Custom WordPress Theme

Finding developer for your custom WordPress theme

Due to its ease of use and low barrier of entry, there is a wide-range of people and companies offering custom WordPress theme services.

Finding a developer or agency with right experience and skill set can be a bit difficult. Specially because a lot of “website assemblers” also call themselves developers.

Here are some places where you can find experienced developers for your custom WordPress theme project.

Genesis DevelopersStudioPress, creators of the famous Genesis theme framework has a developers showcase where you can find experienced WordPress developers to work on your custom theme.

WPEngine Consultants – Managed WordPress hosting company, WPEngine, also has a dedicated page that lists experienced WordPress developers and agencies.

WPHired – This is a job board where you can post your WordPress jobs. Developers can then apply for the job, and you can discuss your project with them. You’ll have to look for developers with relevant experience and skills.

WordPress Jobs – Another WordPress specific job board where you can post jobs and interview developers.

Upwork – An online freelancing website where you can post your job and interview developers from all over the world. This would allow you to find developers with lower rates. It is an enormous community with designers and developers of varying skills and expertise.

Conclusion

A custom WordPress theme can make your website stand out with its unique design and custom features. However, not all beginners and small businesses can afford that right away.

If you are just starting out, then you can use a premium multipurpose theme and build your website at a fraction of a price.

Most modern themes have enough customization options that you can use to make them unique. Check out our showcase section where we regularly publish collection of themes for different industries and niches

However if you can afford a custom WordPress theme, then it is definitely worth the investment. Unique branding, custom design, and tailor made functionality will help you grow your business faster and give you an edge over your competitors.

We hope this article helped you understand how much does a custom WordPress theme cost and how you can avoid overpaying. You may also want to see our list of most notable big name brands using 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 Much Does a Custom WordPress Theme Cost? appeared first on WPBeginner.

Exploring refit, an automatic type-safe REST library for .NET Standard

I dig everything that Paul Betts does. He’s a lovely person and a prolific coder. One of his recent joints is called Refit. It’s a REST library for .NET that is inspired by Square’s Retrofit library. It turns your REST API into a live interface:

public interface IGitHubApi
{
[Get("/users/{user}")]
Task<User> GetUser(string user);
}

That’s an interface that describes a REST API that’s elsewhere. Then later you just make a RestService.For<YourInterface> and you go to town.

var gitHubApi = RestService.For<IGitHubApi>("https://api.github.com");

var octocat = await gitHubApi.GetUser("octocat");

imageThat’s lovely! It is a .NET Standard 1.4 library which means you can use it darn near everywhere. Remember that .NET Standard isn’t a runtime, it’s a version interface – a list of methods you can use under many different “.NETs.” You can use Refit on UWP, Xamarin.*, .NET “full” Frameowrk, and .NET Core, which runs basically everywhere.

Sure, you can make your own HttpClient calls, but that’s a little low level and somewhat irritating. Sure, you can look for a .NET SDK for your favorite REST interface but what if it doesn’t have one? It strikes a nice balance between the low-level and the high-level.

I’ll give an example and use it as a tiny exercise for Refit. I have a service that hosts a realtime feed of my blood sugar, as I’m a Type 1 Diabetic. Since I have a Continuous Glucose Meter that is attached to me and sending my sugar details to a web service called Nightscout running in Azure, I figured it’d be cool to use Refit to pull my sugar info back down with .NET.

The REST API for Nightscout is simple, but doe have a lot of options, query strings, and multiple endpoints. I can start by making a simple interface for the little bits I want now, and perhaps expand the interface later to get more.

For example, if I want my sugars, I would go

https://MYWEBSITE/api/v1/entries.json?count=10

And get back some JSON data like this:

[
{
_id: "5993c4aa8d60c09b63ba1c",
sgv: 162,
date: 1502856279000,
dateString: "2017-08-16T04:04:39.000Z",
trend: 4,
direction: "Flat",
device: "share2",
type: "sgv"
},
{
_id: "5993c37d8d60c09b93ba0b",
sgv: 162,
date: 1502855979000,
dateString: "2017-08-16T03:59:39.000Z",
trend: 4,
direction: "Flat",
device: "share2",
type: "sgv"
}
]

Where “sgv” is serum glucose value, or blood sugar.

Starting with .NET Core 2.0 and the SDK that I installed from http://dot.net, I’ll first make a console app from the command line and add refit like this:

C:\users\scott\desktop\refitsugars> dotnet new console
C:\users\scott\desktop\refitsugars> dotnet add package refit

Here’s my little bit of code.

  • I made an object shaped like each recorded. Added aliases for weirdly named stuff like “sgv”
  • COOL SIDE NOTE: I added <LangVersion>7.1</LangVersion> to my project so I could have my public static Main entry point be async. That’s new as many folks have wanted to have a “public static async void Main()” equivalent.

After that it’s REALLY lovely and super easy to make a quick strongly-typed REST Client in C# for pretty much anything. I could see myself easily extending this to include the whole NightScout diabetes management API without a lot of effort.

using Newtonsoft.Json;
using Refit;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace refitsugars
{
public interface INightScoutApi
{
[Get("/api/v1/entries.json?count={count}")]
Task<List<Sugar>> GetSugars(int count);
}

public class Sugar
{
[JsonProperty(PropertyName = "_id")]
public string id { get; set; }

[JsonProperty(PropertyName = "sgv")]
public int glucose { get; set; }

[JsonProperty(PropertyName = "dateString")]
public DateTime itemDate { get; set; }
public int trend { get; set; }
}

class Program
{
public static async Task Main(string[] args)
{
var nsAPI = RestService.For<INightScoutApi>("https://MYURL.azurewebsites.net");
var sugars = await nsAPI.GetSugars(3);
sugars.ForEach(x => { Console.WriteLine($"{x.itemDate.ToLocalTime()} {x.glucose} mg/dl"); });
}
}
}

And here’s the result of the run.

PS C:\Users\scott\Desktop\refitsugars> dotnet run
8/15/2017 10:29:39 PM 110 mg/dl
8/15/2017 10:24:39 PM 108 mg/dl
8/15/2017 10:19:40 PM 109 mg/dl

You should definitely check out Refit. It’s very easy and quite fun. The fact that it targets .NET Standard 1.4 means you can use it in nearly all your .NET projects, and it already has creative people thinking of cool ideas.


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.
     

I dig everything that Paul Betts does. He's a lovely person and a prolific coder. One of his recent joints is called Refit. It's a REST library for .NET that is inspired by Square's Retrofit library. It turns your REST API into a live interface:

public interface IGitHubApi

{
[Get("/users/{user}")]
Task<User> GetUser(string user);
}

That's an interface that describes a REST API that's elsewhere. Then later you just make a RestService.For<YourInterface> and you go to town.

var gitHubApi = RestService.For<IGitHubApi>("https://api.github.com");


var octocat = await gitHubApi.GetUser("octocat");

imageThat's lovely! It is a .NET Standard 1.4 library which means you can use it darn near everywhere. Remember that .NET Standard isn't a runtime, it's a version interface - a list of methods you can use under many different ".NETs." You can use Refit on UWP, Xamarin.*, .NET "full" Frameowrk, and .NET Core, which runs basically everywhere.

Sure, you can make your own HttpClient calls, but that's a little low level and somewhat irritating. Sure, you can look for a .NET SDK for your favorite REST interface but what if it doesn't have one? It strikes a nice balance between the low-level and the high-level.

I'll give an example and use it as a tiny exercise for Refit. I have a service that hosts a realtime feed of my blood sugar, as I'm a Type 1 Diabetic. Since I have a Continuous Glucose Meter that is attached to me and sending my sugar details to a web service called Nightscout running in Azure, I figured it'd be cool to use Refit to pull my sugar info back down with .NET.

The REST API for Nightscout is simple, but doe have a lot of options, query strings, and multiple endpoints. I can start by making a simple interface for the little bits I want now, and perhaps expand the interface later to get more.

For example, if I want my sugars, I would go

https://MYWEBSITE/api/v1/entries.json?count=10

And get back some JSON data like this:

[

{
_id: "5993c4aa8d60c09b63ba1c",
sgv: 162,
date: 1502856279000,
dateString: "2017-08-16T04:04:39.000Z",
trend: 4,
direction: "Flat",
device: "share2",
type: "sgv"
},
{
_id: "5993c37d8d60c09b93ba0b",
sgv: 162,
date: 1502855979000,
dateString: "2017-08-16T03:59:39.000Z",
trend: 4,
direction: "Flat",
device: "share2",
type: "sgv"
}
]

Where "sgv" is serum glucose value, or blood sugar.

Starting with .NET Core 2.0 and the SDK that I installed from http://dot.net, I'll first make a console app from the command line and add refit like this:

C:\users\scott\desktop\refitsugars> dotnet new console

C:\users\scott\desktop\refitsugars> dotnet add package refit

Here's my little bit of code.

  • I made an object shaped like each recorded. Added aliases for weirdly named stuff like "sgv"
  • COOL SIDE NOTE: I added <LangVersion>7.1</LangVersion> to my project so I could have my public static Main entry point be async. That's new as many folks have wanted to have a "public static async void Main()" equivalent.

After that it's REALLY lovely and super easy to make a quick strongly-typed REST Client in C# for pretty much anything. I could see myself easily extending this to include the whole NightScout diabetes management API without a lot of effort.

using Newtonsoft.Json;

using Refit;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace refitsugars
{
public interface INightScoutApi
{
[Get("/api/v1/entries.json?count={count}")]
Task<List<Sugar>> GetSugars(int count);
}

public class Sugar
{
[JsonProperty(PropertyName = "_id")]
public string id { get; set; }

[JsonProperty(PropertyName = "sgv")]
public int glucose { get; set; }

[JsonProperty(PropertyName = "dateString")]
public DateTime itemDate { get; set; }
public int trend { get; set; }
}

class Program
{
public static async Task Main(string[] args)
{
var nsAPI = RestService.For<INightScoutApi>("https://MYURL.azurewebsites.net");
var sugars = await nsAPI.GetSugars(3);
sugars.ForEach(x => { Console.WriteLine($"{x.itemDate.ToLocalTime()} {x.glucose} mg/dl"); });
}
}
}

And here's the result of the run.

PS C:\Users\scott\Desktop\refitsugars> dotnet run

8/15/2017 10:29:39 PM 110 mg/dl
8/15/2017 10:24:39 PM 108 mg/dl
8/15/2017 10:19:40 PM 109 mg/dl

You should definitely check out Refit. It's very easy and quite fun. The fact that it targets .NET Standard 1.4 means you can use it in nearly all your .NET projects, and it already has creative people thinking of cool ideas.


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.
     

5 Best Popular Posts Plugins for WordPress

While browsing the web, you’ve probably come across websites that have popular articles section. Displaying popular posts help your website visitors find your best content and boost your pageviews. If you want to add a popular posts section on your site, then you’re in the… Read More »

The post 5 Best Popular Posts Plugins for WordPress appeared first on WPBeginner.

While browsing the web, you’ve probably come across websites that have popular articles section. Displaying popular posts help your website visitors find your best content and boost your pageviews. If you want to add a popular posts section on your site, then you’re in the right place. In this article, we will show you the best popular posts plugins for WordPress.

Best popular posts plugins for WordPress

Showing Popular Posts on Your WordPress Site

Before you pickup a plugin to show off your most popular content, you may want to look around and see how other successful websites are doing it.

For example, some site owners stick to the all-time most popular articles. Other popular blogs show articles that are trending that day, week, or month. This allows them to skip their old popular articles and get more pageviews for their recently trending articles.

Popular posts on list25

A few websites combine popular, recent, and most discussed articles in a tabbed widget or a featured content slider.

Trending articles example

You also need to decide where do you want to show the popular posts on your website. You can show it on front page, single articles, or every page on your website. Testing different placements will help you find out what works best for your website.

That being said, let’s take a look at some of the best popular posts plugins for WordPress.

1. WordPress Popular Posts

WordPress Popular Posts Widget

With over 200,000 active installs, WordPress Popular Posts plugin is one of the most downloaded popular posts plugin in the market. It allows you to show popular posts with many different conditions. You can show recently trending articles by selecting a date range. You can also show most commented or most viewed articles.

It is multi-widget capable which means you can add the same widget multiple times into the same or different sidebar. You can apply your own custom CSS, show post thumbnails, excerpts, author, comment count, number of views, and more.

Pros: WordPress popular posts is a powerful plugin with all the options that you would need to display your popular posts. Support for custom post types and the ability to add the widget multiple times allows you create different set of popular views, e.g. Popular Posts, Popular Reviews, etc.

Cons: The plugin creates two extra tables in the database to store popular posts data and cache. While some people might argue that it is a better approach to keep this data out of default WordPress tables, other may find it database intensive.

2. Top 10 – Popular posts plugin for WordPress

Top 10 - Popular posts plugin for WordPress

Top 10 popular posts plugin for WordPress is another strong candidate in our list of the best popular posts plugins. As far as the features are concerned, it matches WordPress Popular Posts and even adds some more features. Top 10 also comes with a highly configurable widget and shortcodes.

Despite the name, the plugin actually allows you to display any number of popular posts. It allows you to select a date range to choose from. You can show post views, author, post summary or excerpt, and post thumbnails in the popular posts list.

Top 10 comes with a built-in caching system to make it less resource intensive. It also plays along nicely with WordPress caching plugins like W3 Total Cache and WP Super Cache.

Pros: Top 10 Popular Posts Plugin is feature rich, flexible, and easy to setup. It has aggressive caching to reduce the server load, and it works nicely with WordPress caching plugins.

Cons: Plugin settings page have way too many options and beginners may find it a bit complicated.

3. Relevant

Relevant

Would you like your popular posts plugin to also show your featured articles, related content, and latest posts? Relevant allows you to do that. It comes with multiple widgets including one for popular posts and a neat settings page.

You can display popular posts by comments or by page views. It also allows you to display post thumbnail, author, excerpt, and post date.

Don’t want to use the widget? Relevant also comes with shortcodes and template tags that you can use to display popular posts anywhere on your website. You can also enable post blocks before or after post content.

Pros: It combines featured, latest, and related posts functionality into one convenient package.

Cons: The popular posts feature does not allow you to show popular posts in a particular date range.

4. WP-PostRatings

WP-PostRatings

Want to show the most highly rated posts on your website? WP-PostRatings helps you to do that. It allows your users to rate articles on your website.

You can choose the rating icons, and who can vote on articles (all users vs only logged in users). It supports rich snippets, and it is highly customizable through filters and template tags.

The best part about the plugin is its ratings widget which shows top rated posts on your website. This allows you to show popular posts by user votes. The plugin also works with WordPress Popular Posts plugin.

For detailed instructions, see our guide on how to add post rating system in WordPress

Pros: You can show popular posts based on user rating instead of page views or comments.

Cons: To implement the plugin, you will need to add template tags in your WordPress theme files. If you haven’t done this before, then check out our guide on how to copy and paste code in WordPress.

5. Trending/Popular Post Slider and Widget

Popular posts slider

As the name suggests, this plugin allows you to show popular posts in a slider, a grid block, or as a plain list. This way you can show your best content in more engaging ways than just a list of links in your sidebar.

It comes with a simple settings page where you can choose the time range. This allows you to show posts trending during a particular year, month, or week.

The plugin comes with easy to use shortcodes that you can add to your posts or pages. You can also use the shortcode in your page builder plugin modules.

If you want to implement it directly into your theme, then you can use template tags to do that.

Pros: Ability to add popular posts sliders, carousels, and grid blocks and show them anywhere on your site.

Cons: Limited features than other popular posts plugin. The slider, carousel, and grid blocks only work with shortcode. The widget is basically a list of links with post thumbnails, excerpt, and some meta data.

We hope this article helped you find the best popular posts plugin for WordPress. You may also want to see our list of the 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 5 Best Popular Posts Plugins for WordPress appeared first on WPBeginner.

5 Best Popular Posts Plugins for WordPress

While browsing the web, you’ve probably come across websites that have popular articles section. Displaying popular posts help your website visitors find your best content and boost your pageviews. If you want to add a popular posts section on your site, then you’re in the… Read More »

The post 5 Best Popular Posts Plugins for WordPress appeared first on WPBeginner.

While browsing the web, you’ve probably come across websites that have popular articles section. Displaying popular posts help your website visitors find your best content and boost your pageviews. If you want to add a popular posts section on your site, then you’re in the right place. In this article, we will show you the best popular posts plugins for WordPress.

Best popular posts plugins for WordPress

Showing Popular Posts on Your WordPress Site

Before you pickup a plugin to show off your most popular content, you may want to look around and see how other successful websites are doing it.

For example, some site owners stick to the all-time most popular articles. Other popular blogs show articles that are trending that day, week, or month. This allows them to skip their old popular articles and get more pageviews for their recently trending articles.

Popular posts on list25

A few websites combine popular, recent, and most discussed articles in a tabbed widget or a featured content slider.

Trending articles example

You also need to decide where do you want to show the popular posts on your website. You can show it on front page, single articles, or every page on your website. Testing different placements will help you find out what works best for your website.

That being said, let’s take a look at some of the best popular posts plugins for WordPress.

1. WordPress Popular Posts

WordPress Popular Posts Widget

With over 200,000 active installs, WordPress Popular Posts plugin is one of the most downloaded popular posts plugin in the market. It allows you to show popular posts with many different conditions. You can show recently trending articles by selecting a date range. You can also show most commented or most viewed articles.

It is multi-widget capable which means you can add the same widget multiple times into the same or different sidebar. You can apply your own custom CSS, show post thumbnails, excerpts, author, comment count, number of views, and more.

Pros: WordPress popular posts is a powerful plugin with all the options that you would need to display your popular posts. Support for custom post types and the ability to add the widget multiple times allows you create different set of popular views, e.g. Popular Posts, Popular Reviews, etc.

Cons: The plugin creates two extra tables in the database to store popular posts data and cache. While some people might argue that it is a better approach to keep this data out of default WordPress tables, other may find it database intensive.

2. Top 10 – Popular posts plugin for WordPress

Top 10 - Popular posts plugin for WordPress

Top 10 popular posts plugin for WordPress is another strong candidate in our list of the best popular posts plugins. As far as the features are concerned, it matches WordPress Popular Posts and even adds some more features. Top 10 also comes with a highly configurable widget and shortcodes.

Despite the name, the plugin actually allows you to display any number of popular posts. It allows you to select a date range to choose from. You can show post views, author, post summary or excerpt, and post thumbnails in the popular posts list.

Top 10 comes with a built-in caching system to make it less resource intensive. It also plays along nicely with WordPress caching plugins like W3 Total Cache and WP Super Cache.

Pros: Top 10 Popular Posts Plugin is feature rich, flexible, and easy to setup. It has aggressive caching to reduce the server load, and it works nicely with WordPress caching plugins.

Cons: Plugin settings page have way too many options and beginners may find it a bit complicated.

3. Relevant

Relevant

Would you like your popular posts plugin to also show your featured articles, related content, and latest posts? Relevant allows you to do that. It comes with multiple widgets including one for popular posts and a neat settings page.

You can display popular posts by comments or by page views. It also allows you to display post thumbnail, author, excerpt, and post date.

Don’t want to use the widget? Relevant also comes with shortcodes and template tags that you can use to display popular posts anywhere on your website. You can also enable post blocks before or after post content.

Pros: It combines featured, latest, and related posts functionality into one convenient package.

Cons: The popular posts feature does not allow you to show popular posts in a particular date range.

4. WP-PostRatings

WP-PostRatings

Want to show the most highly rated posts on your website? WP-PostRatings helps you to do that. It allows your users to rate articles on your website.

You can choose the rating icons, and who can vote on articles (all users vs only logged in users). It supports rich snippets, and it is highly customizable through filters and template tags.

The best part about the plugin is its ratings widget which shows top rated posts on your website. This allows you to show popular posts by user votes. The plugin also works with WordPress Popular Posts plugin.

For detailed instructions, see our guide on how to add post rating system in WordPress

Pros: You can show popular posts based on user rating instead of page views or comments.

Cons: To implement the plugin, you will need to add template tags in your WordPress theme files. If you haven’t done this before, then check out our guide on how to copy and paste code in WordPress.

5. Trending/Popular Post Slider and Widget

Popular posts slider

As the name suggests, this plugin allows you to show popular posts in a slider, a grid block, or as a plain list. This way you can show your best content in more engaging ways than just a list of links in your sidebar.

It comes with a simple settings page where you can choose the time range. This allows you to show posts trending during a particular year, month, or week.

The plugin comes with easy to use shortcodes that you can add to your posts or pages. You can also use the shortcode in your page builder plugin modules.

If you want to implement it directly into your theme, then you can use template tags to do that.

Pros: Ability to add popular posts sliders, carousels, and grid blocks and show them anywhere on your site.

Cons: Limited features than other popular posts plugin. The slider, carousel, and grid blocks only work with shortcode. The widget is basically a list of links with post thumbnails, excerpt, and some meta data.

We hope this article helped you find the best popular posts plugin for WordPress. You may also want to see our list of the 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 5 Best Popular Posts Plugins for WordPress appeared first on WPBeginner.