How to Add Google Slides Presentations to WordPress

Do you want to embed Google Slides presentation on your WordPress site? Google Slides allows you to create beautiful presentations and share them anywhere. In this article, we will show you how to easily add Google Slides presentations in WordPress. Method 1: Add Google Slides… Read More »

The post How to Add Google Slides Presentations to WordPress appeared first on WPBeginner.

Do you want to embed Google Slides presentation on your WordPress site? Google Slides allows you to create beautiful presentations and share them anywhere. In this article, we will show you how to easily add Google Slides presentations in WordPress.

Google Slides for WordPress

Method 1: Add Google Slides in WordPress Using Plugin

This method is easier and recommended for beginners.

First, you need to install and activate the Google Docs oEmbed plugin. For more details, see our step by step guide on how to install a WordPress plugin.

The plugin works out of the box, and there are no settings for you to configure.

Before you can embed your presentation, you will need the shareable URL of your Google Slides presentation.

You can get that by opening your presentation in Google Slides and then clicking on File » Publish to the web.

Make your presentation publicly accessible on the web

This will bring up a popup where you can configure slideshow settings like delay between slides and autoplay.

Change slideshow settings and publish your presentation

You will need to click on the publish button to continue.

This will bring up a popup asking you to confirm that you want to publish the slide. Click on the OK button to give permission.

You should be able to see a URL that you can use to share your Google Slides presentation.

URL to share your Google Slides presentation

Go ahead and copy this URL and return back to the admin area of your WordPress site.

Now you just need to add this URL in your WordPress. Simply edit the post or page where you want to display the slide.

In the post editor, you need to paste the URL you just copied from Google Slides. It’s important to make sure that the URL is on its own line.

Add your Google Slides presentation URL here

If you are using the Visual editor, then as soon as you enter the URL it will display your presentation in the editor.

You can now click on the publish or update button to save your changes.

If you need to adjust the height and width of the Google Slides container, then you need to wrap the URL around an embed shortcode.

[embed height=”900″ width=”400″]Slides URL[/embed]

Don’t forget to replace Slides URL with the shareable URL of your Google Slides presentation.

That’s all, you can now preview your post or page to see your Google Slide embedded into your WordPress site.

Preview of a Google Slides presentation in WordPress

Method 2: Adding Google Slides Embed Code in WordPress

This method does not require you to install any plugin. We only recommend using this method if you will not be frequently adding Google Slides to your WordPress site.

First you need to open the presentation you want to share and then click on File » Publish to the web.

Make your presentation publicly accessible on the web

You will see a popup where you can configure the slideshow settings. You need to click on the publish button to make your presentation public.

Change slideshow settings and publish your presentation

Next, you will see a popup asking you to confirm that you want to publish the slide. Click on OK button to give permission.

Now you need to switch to the Embed tab and copy the embed code.

Copy the embed code

Head over to the WordPress admin area and edit the post or page where you want to add your Google Slides presentation.

On the post editor screen, you will need to switch from Visual to Text editor and then paste your code in the editor.

Add your embed code in post editor

You can now save or update your post/page. Visit your website to see your Google Slides presentation in action.

Note: It is important that you don’t switch to the visual editor after adding your embed code. Switching to visual editor will mess up the embed code, and you will then see it as plain text instead of your slides.

We hope this article helped you learn how to add Google Slides presentations to WordPress. You may also want to see our list of 19+ free Google tools every WordPress blogger should try.

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 Add Google Slides Presentations to WordPress appeared first on WPBeginner.

NoSQL .NET Core development using an local Azure DocumentDB Emulator

I was hanging out with Miguel de Icaza in New York a few weeks ago and he was sharing with me his ongoing love affair with a NoSQL Database called Azure DocumentDB. I’ve looked at it a few times over the last year or so and though it was cool but I didn’t feel like using it for a few reasons:

  • Can’t develop locally – I’m often in low-bandwidth or airplane situations
  • No MongoDB support – I have existing apps written in Node that use Mongo
  • No .NET Core support – I’m doing mostly cross-platform .NET Core apps

Miguel told me to take a closer look. Looks like things have changed! DocumentDB now has:

  • Free local DocumentDB Emulator – I asked and this is the SAME code that runs in Azure with just changes like using the local file system for persistence, etc. It’s an “emulator” but it’s really the essential same core engine code. There is no cost and no sign in for the local DocumentDB emulator.
  • MongoDB protocol support – This is amazing. I literally took an existing Node app, downloaded MongoChef and copied my collection over into Azure using a standard MongoDB connection string, then pointed my app at DocumentDB and it just worked. It’s using DocumentDB for storage though, which gives me
    • Better Latency
    • Turnkey global geo-replication (like literally a few clicks)
    • A performance SLA with <10ms read and <15ms write (Service Level Agreement)
    • Metrics and Resource Management like every Azure Service
  • DocumentDB .NET Core Preview SDK that has feature parity with the .NET Framework SDK.

There’s also Node, .NET, Python, Java, and C++ SDKs for DocumentDB so it’s nice for gaming on Unity, Web Apps, or any .NET App…including Xamarin mobile apps on iOS and Android which is why Miguel is so hype on it.

Azure DocumentDB Local Quick Start

I wanted to see how quickly I could get started. I spoke with the PM for the project on Azure Friday and downloaded and installed the local emulator. The lead on the project said it’s Windows for now but they are looking for cross-platform solutions. After it was installed it popped up my web browser with a local web page – I wish more development tools would have such clean Quick Starts. There’s also a nice quick start on using DocumentDB with ASP.NET MVC.

NOTE: This is a 0.1.0 release. Definitely Alpha level. For example, the sample included looks like it had the package name changed at some point so it didn’t line up. I had to change “Microsoft.Azure.Documents.Client”: “0.1.0” to “Microsoft.Azure.DocumentDB.Core”: “0.1.0-preview” so a little attention to detail issue there. I believe the intent is for stuff to Just Work. 😉

Nice DocumentDB Quick Start

The sample app is a pretty standard “ToDo” app:

ASP.NET MVC ToDo App using Azure Document DB local emulator

The local Emulator also includes a web-based local Data Explorer:

image

A Todo Item is really just a POCO (Plain Old CLR Object) like this:

namespace todo.Models
{
    using Newtonsoft.Json;
    public class Item
    {
        [JsonProperty(PropertyName = "id")]
        public string Id { get; set; }
        [JsonProperty(PropertyName = "name")]
        public string Name { get; set; }
        [JsonProperty(PropertyName = "description")]
        public string Description { get; set; }
        [JsonProperty(PropertyName = "isComplete")]
        public bool Completed { get; set; }
    }
}

The MVC Controller in the sample uses an underlying repository pattern so the code is super simple at that layer – as an example:

[ActionName("Index")]
public async Task<IActionResult> Index()
{
var items = await DocumentDBRepository<Item>.GetItemsAsync(d => !d.Completed);
return View(items);
}

[HttpPost]
[ActionName("Create")]
[ValidateAntiForgeryToken]
public async Task<ActionResult> CreateAsync([Bind("Id,Name,Description,Completed")] Item item)
{
if (ModelState.IsValid)
{
await DocumentDBRepository<Item>.CreateItemAsync(item);
return RedirectToAction("Index");
}

return View(item);
}

The Repository itself that’s abstracting away the complexities is itself not that complex. It’s like 120 lines of code, and really more like 60 when you remove whitespace and curly braces. And half of that is just initialization and setup. It’s also DocumentDBRepository<T> so it’s a generic you can change to meet your tastes and use it however you’d like.

The only thing that stands out to me in this sample is the loopp in GetItemsAsync that’s hiding potential paging/chunking. It’s nice you can pass in a predicate but I’ll want to go and put in some paging logic for large collections.

public static async Task<T> GetItemAsync(string id)
{
    try
    {
        Document document = await client.ReadDocumentAsync(UriFactory.CreateDocumentUri(DatabaseId, CollectionId, id));
        return (T)(dynamic)document;
    }
    catch (DocumentClientException e)
    {
        if (e.StatusCode == System.Net.HttpStatusCode.NotFound){
            return null;
        }
        else {
            throw;
        }
    }
}
public static async Task<IEnumerable<T>> GetItemsAsync(Expression<Func<T, bool>> predicate)
{
    IDocumentQuery<T> query = client.CreateDocumentQuery<T>(
        UriFactory.CreateDocumentCollectionUri(DatabaseId, CollectionId),
        new FeedOptions { MaxItemCount = -1 })
        .Where(predicate)
        .AsDocumentQuery();
    List<T> results = new List<T>();
    while (query.HasMoreResults){
        results.AddRange(await query.ExecuteNextAsync<T>());
    }
    return results;
}
public static async Task<Document> CreateItemAsync(T item)
{
    return await client.CreateDocumentAsync(UriFactory.CreateDocumentCollectionUri(DatabaseId, CollectionId), item);
}
public static async Task<Document> UpdateItemAsync(string id, T item)
{
    return await client.ReplaceDocumentAsync(UriFactory.CreateDocumentUri(DatabaseId, CollectionId, id), item);
}
public static async Task DeleteItemAsync(string id)
{
    await client.DeleteDocumentAsync(UriFactory.CreateDocumentUri(DatabaseId, CollectionId, id));
}

I’m going to keep playing with this but so far I’m pretty happy I can get this far while on an airplane. It’s really easy (given I’m preferring NoSQL over SQL lately) to just through objects at it and store them.

In another post I’m going to look at RavenDB, another great NoSQL Document Database that works on .NET Core that s also Open Source.


Sponsor: Big thanks to Octopus Deploy! Do you deploy the same application multiple times for each of your end customers? The team at Octopus have taken the pain out of multi-tenant deployments. Check out their latest 3.4 release


© 2016 Scott Hanselman. All rights reserved.
     

I was hanging out with Miguel de Icaza in New York a few weeks ago and he was sharing with me his ongoing love affair with a NoSQL Database called Azure DocumentDB. I've looked at it a few times over the last year or so and though it was cool but I didn't feel like using it for a few reasons:

  • Can't develop locally - I'm often in low-bandwidth or airplane situations
  • No MongoDB support - I have existing apps written in Node that use Mongo
  • No .NET Core support - I'm doing mostly cross-platform .NET Core apps

Miguel told me to take a closer look. Looks like things have changed! DocumentDB now has:

  • Free local DocumentDB Emulator - I asked and this is the SAME code that runs in Azure with just changes like using the local file system for persistence, etc. It's an "emulator" but it's really the essential same core engine code. There is no cost and no sign in for the local DocumentDB emulator.
  • MongoDB protocol support - This is amazing. I literally took an existing Node app, downloaded MongoChef and copied my collection over into Azure using a standard MongoDB connection string, then pointed my app at DocumentDB and it just worked. It's using DocumentDB for storage though, which gives me
    • Better Latency
    • Turnkey global geo-replication (like literally a few clicks)
    • A performance SLA with <10ms read and <15ms write (Service Level Agreement)
    • Metrics and Resource Management like every Azure Service
  • DocumentDB .NET Core Preview SDK that has feature parity with the .NET Framework SDK.

There's also Node, .NET, Python, Java, and C++ SDKs for DocumentDB so it's nice for gaming on Unity, Web Apps, or any .NET App...including Xamarin mobile apps on iOS and Android which is why Miguel is so hype on it.

Azure DocumentDB Local Quick Start

I wanted to see how quickly I could get started. I spoke with the PM for the project on Azure Friday and downloaded and installed the local emulator. The lead on the project said it's Windows for now but they are looking for cross-platform solutions. After it was installed it popped up my web browser with a local web page - I wish more development tools would have such clean Quick Starts. There's also a nice quick start on using DocumentDB with ASP.NET MVC.

NOTE: This is a 0.1.0 release. Definitely Alpha level. For example, the sample included looks like it had the package name changed at some point so it didn't line up. I had to change "Microsoft.Azure.Documents.Client": "0.1.0" to "Microsoft.Azure.DocumentDB.Core": "0.1.0-preview" so a little attention to detail issue there. I believe the intent is for stuff to Just Work. ;)

Nice DocumentDB Quick Start

The sample app is a pretty standard "ToDo" app:

ASP.NET MVC ToDo App using Azure Document DB local emulator

The local Emulator also includes a web-based local Data Explorer:

image

A Todo Item is really just a POCO (Plain Old CLR Object) like this:

namespace todo.Models
{
    using Newtonsoft.Json;
    public class Item
    {
        [JsonProperty(PropertyName = "id")]
        public string Id { get; set; }
        [JsonProperty(PropertyName = "name")]
        public string Name { get; set; }
        [JsonProperty(PropertyName = "description")]
        public string Description { get; set; }
        [JsonProperty(PropertyName = "isComplete")]
        public bool Completed { get; set; }
    }
}

The MVC Controller in the sample uses an underlying repository pattern so the code is super simple at that layer - as an example:

[ActionName("Index")]

public async Task<IActionResult> Index()
{
var items = await DocumentDBRepository<Item>.GetItemsAsync(d => !d.Completed);
return View(items);
}

[HttpPost]
[ActionName("Create")]
[ValidateAntiForgeryToken]
public async Task<ActionResult> CreateAsync([Bind("Id,Name,Description,Completed")] Item item)
{
if (ModelState.IsValid)
{
await DocumentDBRepository<Item>.CreateItemAsync(item);
return RedirectToAction("Index");
}

return View(item);
}

The Repository itself that's abstracting away the complexities is itself not that complex. It's like 120 lines of code, and really more like 60 when you remove whitespace and curly braces. And half of that is just initialization and setup. It's also DocumentDBRepository<T> so it's a generic you can change to meet your tastes and use it however you'd like.

The only thing that stands out to me in this sample is the loopp in GetItemsAsync that's hiding potential paging/chunking. It's nice you can pass in a predicate but I'll want to go and put in some paging logic for large collections.

public static async Task<T> GetItemAsync(string id)
{
    try
    {
        Document document = await client.ReadDocumentAsync(UriFactory.CreateDocumentUri(DatabaseId, CollectionId, id));
        return (T)(dynamic)document;
    }
    catch (DocumentClientException e)
    {
        if (e.StatusCode == System.Net.HttpStatusCode.NotFound){
            return null;
        }
        else {
            throw;
        }
    }
}
public static async Task<IEnumerable<T>> GetItemsAsync(Expression<Func<T, bool>> predicate)
{
    IDocumentQuery<T> query = client.CreateDocumentQuery<T>(
        UriFactory.CreateDocumentCollectionUri(DatabaseId, CollectionId),
        new FeedOptions { MaxItemCount = -1 })
        .Where(predicate)
        .AsDocumentQuery();
    List<T> results = new List<T>();
    while (query.HasMoreResults){
        results.AddRange(await query.ExecuteNextAsync<T>());
    }
    return results;
}
public static async Task<Document> CreateItemAsync(T item)
{
    return await client.CreateDocumentAsync(UriFactory.CreateDocumentCollectionUri(DatabaseId, CollectionId), item);
}
public static async Task<Document> UpdateItemAsync(string id, T item)
{
    return await client.ReplaceDocumentAsync(UriFactory.CreateDocumentUri(DatabaseId, CollectionId, id), item);
}
public static async Task DeleteItemAsync(string id)
{
    await client.DeleteDocumentAsync(UriFactory.CreateDocumentUri(DatabaseId, CollectionId, id));
}

I'm going to keep playing with this but so far I'm pretty happy I can get this far while on an airplane. It's really easy (given I'm preferring NoSQL over SQL lately) to just through objects at it and store them.

In another post I'm going to look at RavenDB, another great NoSQL Document Database that works on .NET Core that s also Open Source.


Sponsor: Big thanks to Octopus Deploy! Do you deploy the same application multiple times for each of your end customers? The team at Octopus have taken the pain out of multi-tenant deployments. Check out their latest 3.4 release


© 2016 Scott Hanselman. All rights reserved.
     

How to Properly Setup Google AMP on Your WordPress Site

Do you want to setup Google AMP on your WordPress site? Accelerated mobile pages or AMP is a way to make your website load faster on mobile devices. Fast loading websites offer better user experience and can improve your traffic. In this article, we will… Read More »

The post How to Properly Setup Google AMP on Your WordPress Site appeared first on WPBeginner.

Do you want to setup Google AMP on your WordPress site? Accelerated mobile pages or AMP is a way to make your website load faster on mobile devices. Fast loading websites offer better user experience and can improve your traffic. In this article, we will show you how to set up Google AMP in WordPress.

Google AMP for WordPress

What is Google AMP?

Google AMP stands for Accelerated Mobile Pages. It is an open source initiative supported by technology companies like Google and Twitter. The goal of the project is to make web content load faster for mobile users.

For many mobile users, reading on the web is often slow. Most content rich pages take several seconds to load despite all efforts taken by site owners to speed up their website.

Accelerated Mobile Pages (AMP) in search and browser view

Accelerated Mobile Pages or AMP uses bare minimal HTML and limited Javascript. This allows the content to be hosted on Google AMP Cache. Google can then serve this cached version to users instantly when they click on your link in the search results.

It is very similar to Facebook Instant Articles. However, Instant Articles are limited only to Facebook’s platform, more specifically to their mobile app.

Accelerated Mobile Pages are platform-agnostic and can be used by any app, browser, or web viewer. Currently it is used by Google, Twitter, LinkedIn, Reddit, and others.

Pros and Cons of Google AMP (Accelerated Mobile Pages)

SEO experts claim that Accelerated Mobile Pages will help you rank higher in Google, and it improves the user experience for mobile users on slow internet connections. However, they are several challenges for website owners, bloggers, and marketers.

AMP uses limited set of HTML, JavaScript, and CSS. This means you cannot add certain widgets and features to your mobile AMP website. This limits your ability to add smart email optin forms, facebook like boxes, and other dynamic scripts.

While Google AMP supports Google Analytics, it does not support many other analytics platforms. Same goes for advertising options which are limited to select few advertising platforms.

Despite its limitations, Google is pushing AMP pages by giving them a boost in mobile search.

If significant chunk of your traffic comes from mobile searches, then you may benefit from adding AMP support to improve and maintain your SEO.

Note: There have been a few complaints about Google AMP by bloggers.

First is by Alex Kras who claim that you can potentially lose mobile traffic if you enable Google AMP. Read the article thoroughly because that’s a huge problem, and despite what the Google Tech Lead for AMP project has said, there aren’t any good solutions that address the issue in our opinion.

Second is by Terrence Eden which highlights the difficulties of switching back from Google AMP should you change your mind in the future. We don’t believe this is a major issue because you can do a 301 redirect which several have pointed out in the comment section of his blog posts, but nonetheless it is something you need to think about.

For the reasons above, we are not switching WPBeginner to Google AMP just yet.

However since several of our readers asked about how to setup Google AMP in WordPress, we have created a step by step process on how to setup Accelerated Mobile Pages in WordPress.

Setting up Accelerated Mobile Pages or AMP in WordPress

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

Upon activation, you can head over to Appearance » AMP page to see how your site looks on mobile devices using AMP.

Settings page for WordPress AMP plugin

You can change the header background and text color on this page. The header background color you choose will also be used for links.

The plugin will also use your site’s icon or logo if your theme supports it. See our guide on how to add a favicon or site icon in WordPress for detailed instructions.

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

You can now visit any single post on your website and add /amp/ at the end of the URL. Like this:

http://example.com/2016/10/my-blog-post/amp/

This will show you a stripped down AMP version of the same post.

AMP mobile preview

If you view the source code of the original post, you will find this line in the HTML:

<link rel="amphtml" href="http://example.com/2016/10/my-blog-post/amp/" />

This line tells search engines and other AMP consuming apps/services where to look for the AMP version of the page.

Troubleshooting:

If you see a 404 error when trying to view the amp version, then here is what you need to do.

Visit Settings » Permalinks page in your WordPress admin and click on the ‘Save Changes’ button. Remember, don’t change anything here, just press the save button. This will refresh your website’s permalink structure.

View Accelerated Mobile Pages in Google Search Console

Want to know how your Accelerated Mobile Pages are doing in Google Search? You can easily check this using the Google Search Console.

Log in to your Google Search Console dashboard and then click on Search Appearance » Accelerated Mobile Pages.

Accelerated mobile pages in Google Search Console

Don’t worry if you don’t see your AMP results right away. It may take a while for Google to index your Accelerated Mobile Pages and then show data in Search Console.

Extending and Customizing Your Accelerated Mobile Pages

The AMP plugin for WordPress comes with very limited customization options. However you can use some other WordPress plugins to add few more customizations.

If you are already using Yoast SEO, then you need to install and activate the Glue for Yoast SEO & AMP.

It is an add-on plugin for Yoast SEO and AMP plugins. Upon activation, you need to visit SEO » AMP page to configure plugin settings.

Yoast SEO AMP Addon

The plugin allows you to enable AMP support for other post types.

On the design tab, you can choose colors and design options. You can also upload a logo and a default header image which will be used when a post does not have its own featured image.

Design tab for AMP using Yoast AMP addon

You can switch to the Analytics tab to add your Google Analytics ID.

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

There are many more plugins which will allow you to add related posts, footer widgets, and even social media icons to your AMP pages.

However, you need to make sure to validate your AMP pages after you install any addon plugins.

We hope this article, helped you learn how to set up Accelerated Mobile Pages (AMP) on WordPress. You may also want to see our list of 19 actionable tips to drive traffic to your WordPress 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 Properly Setup Google AMP on Your WordPress Site appeared first on WPBeginner.

How to Add Post Type Archive in WordPress Navigation Menus

Recently, one of our readers asked if it was possible to add a link to custom post type archive pages in WordPress navigation menus. An archive page in WordPress displays a list of all posts under a specific post type, category, or tag. In this… Read More »

The post How to Add Post Type Archive in WordPress Navigation Menus appeared first on WPBeginner.

Recently, one of our readers asked if it was possible to add a link to custom post type archive pages in WordPress navigation menus. An archive page in WordPress displays a list of all posts under a specific post type, category, or tag. In this article, we will show you how to add post type archive in WordPress navigation menus.

How to add custom post type archive link in navigation menus

Custom Post Type Archives in WordPress

In WordPress, the term ‘Archives’ is used for a list of entries from a post type or taxonomy (like categories and tags).

If archives are enabled for a custom post type, then you can display them on your website. Typically, the URL of your custom post type archive page is in this format:

http://example.com/post-type-slug/

Post type slug is the nice name for your custom post type.

For example, we have a custom post type called ‘Deals’, and you can view its archive page at a URL like this:

http://www.wpbeginner.com/deals/

You can place a link to the archive page of your custom post type in your site’s navigation menus. This will allow your users to see all past entries posted in that post type on a single page.

Having said that, let’s see how to add a link to your custom post type archive page in WordPress navigation menus.

Adding Link to Custom Post Type Archive page in Navigation Menus

First, you need to visit Appearance » Menus page. You will notice a tab for each of your custom post type in the left column.

Custom post type tab on navigation menus screen in WordPress

You need to click on the name of your custom post type to expand it and then click on the ‘View all’ tab.

You will see an option for your post type archives. Check the box next to it and then click on the Add to Menu button.

Your custom post type archive will now appear as a menu item in the right column.

Post type archive menu item

By default, it will use your custom post type name with the word archives for the link label.

You may want to change this into something easier. Click on the menu item to edit it and then change its navigation label.

Menu label

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

You can now visit your website to see the custom post type archive link in your navigation menu.

Custom post type link in WordPress navigation menu

Just like posts and pages, you can also add a single entry from your post type to navigation menus.

Simply select an entry and then click on add to menu button.

Adding single items from a post type to navigation menus

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

My Custom Post Type Doesn’t Appear on Menus Screen

Custom post types need to match some requirements in order to be displayed on Appearance » Menus page.

First you need to make sure that an archive page exists for your custom post type. Typically it is a URL like this:

http://example.com/movies/

Replace example.com with your own domain name and movies with your post type.

If you can see entries from your post type on this page, then this means your post type supports archives but does not support other requirements.

Good news is that you can still add your custom post type archive page as a custom link.

Visit Appearance » Menus page and then click on the ‘Custom Link’ tab to expand it.

Adding a post type archive link as a custom link

Enter the URL of your custom post type archive page in the URL field and add the label you want to display in the link field.

Next, click on the add to menu button, and you will notice the custom link appear in the right column.

Custom link item in navigation menu

You can now click on the save menu button to store your changes.

We hope this article helped you learn how to add post type archive in WordPress navigation menus. You may also want to see our list of 12 most useful WordPress custom post types tutorials.

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 Add Post Type Archive in WordPress Navigation Menus appeared first on WPBeginner.

I suck at vacation – What I did this week

Well, it seems I’m lousy at vacation. I’m still learning what I’m supposed to do. My wife is working and the kids are still in school so here was my week.

3D Printed Brackets for my new HTC Vive

I treated myself to an HTC Vive Room-Scale VR system. I’ll blog extensively about this later but let me just tell you. It’s AMAZING. I’ve used Google Cardboard, I’ve used Gear VR, I’ve used Oculus. Vive is it. Full Room-scale VR with something like the Doom 3 VR Mode is amazing. This fellow has a version of Doom 3 coded up at GitHub that modifies your existing purchased version and adds a REALLY compelling VR experience. I will say spent less time fighting demons and more time looking closely at wall textures. I admit it.

There’s a joke about folks who have 3D Printers. We just end up printing brackets to hold stuff.  Well, I got a Vive so I wanted a nice way to mount it. Problem solved.

I dig #3Dprinting because you can make EXACTLY the brackets you need in a few hours!

A photo posted by Scott Hanselman (@shanselman) on Nov 25, 2016 at 11:40pm PST

3D Printed a Rifle Stock for the Vive

There’s a popular VR game called Onward. It’s basically a Call of Duty-type squad shooter with a focus on squad teamwork and realism. However, holding two VR controllers up to your cheek and pretending they are a rifle doesn’t really work. Fortunately an intrepid maker named SGU7 made a prototype you can 3D Print.

I made one first in Yellow but it broken because it lacked enough infill. I made it again in black (because I had a lot of black. I wish it looked less aggressive, though) and it works great. Note that the part in my hand is a controller and the other controller is attached to the front. The front one can pop off and act as your left hand to reload and throw grenades.

It was a challenging print with five large pieces and two small along with screws and nuts to hold it together. However, it was super fun and it makes the game WAY more realistic. More on this later. I’ve also been experimenting with some new exotic filaments.

37b7b79b793db7b489b50496b1f5787a_preview_featured

Made an AdaFruit Cupcade Raspberry Pi MAME Arcade

My teenage nephew and I worked on a Cupcade a few months ago but it was his. I 3d printed and made a PiGrrl (Raspberry Pi GameBoy) last year, so I figured I’d make a Cupcade (Raspberry Pi tiny Multi-Arcade Machine Emulator) as well. It’s also somewhat challenging but I never really had the time until vacation. You can get the plans and source many of the parts locally, or you can get a complete kit from Adafruit. I did the partial kit for cheaper without the plastic case, then had a local makerspace lasercut a $5 piece of clear acrylic.

Made a second @adafruit Cupcade with a @Raspberry_Pi tonight. #vacation pic.twitter.com/GIVw0u706L

— Scott Hanselman (@shanselman) November 30, 2016

Set up Alexa to talk to my Nightscout-based Blood Sugar system

I got a few Amazon Alexa “Echo Dot” devices, so now we have three around the house. I upgraded my Nightscout Site (this is the Azure-based system that that allows remote management and viewing of my blood sugar as a Type 1 Diabetic.

The most recent update of Nightscout added Alexa support. I headed over to https://developer.amazon.com and made a dev account and got it all working. It’s pretty slick. I can ask it all kinds of things (as can my kids. They love to know about how I’m doing when I’m out of town.)

image

Here’s a video of it working!

“Alexa, what’s my blood sugar?” #Diabetes @nightscoutproj #video

A video posted by Scott Hanselman (@shanselman) on Nov 30, 2016 at 2:44pm PST

Basically I’ve been just making stuff and fixing stuff around the house. I even sat in a café and read the news. Madness.

I wonder if I could do this full time? I guess that’s called retirement. 😉


Sponsor: Big thanks to Octopus Deploy! Do you deploy the same application multiple times for each of your end customers? The team at Octopus have taken the pain out of multi-tenant deployments. Check out their latest 3.4 release


© 2016 Scott Hanselman. All rights reserved.
     

Well, it seems I'm lousy at vacation. I'm still learning what I'm supposed to do. My wife is working and the kids are still in school so here was my week.

3D Printed Brackets for my new HTC Vive

I treated myself to an HTC Vive Room-Scale VR system. I'll blog extensively about this later but let me just tell you. It's AMAZING. I've used Google Cardboard, I've used Gear VR, I've used Oculus. Vive is it. Full Room-scale VR with something like the Doom 3 VR Mode is amazing. This fellow has a version of Doom 3 coded up at GitHub that modifies your existing purchased version and adds a REALLY compelling VR experience. I will say spent less time fighting demons and more time looking closely at wall textures. I admit it.

There's a joke about folks who have 3D Printers. We just end up printing brackets to hold stuff.  Well, I got a Vive so I wanted a nice way to mount it. Problem solved.

I dig #3Dprinting because you can make EXACTLY the brackets you need in a few hours!

A photo posted by Scott Hanselman (@shanselman) on

3D Printed a Rifle Stock for the Vive

There's a popular VR game called Onward. It's basically a Call of Duty-type squad shooter with a focus on squad teamwork and realism. However, holding two VR controllers up to your cheek and pretending they are a rifle doesn't really work. Fortunately an intrepid maker named SGU7 made a prototype you can 3D Print.

I made one first in Yellow but it broken because it lacked enough infill. I made it again in black (because I had a lot of black. I wish it looked less aggressive, though) and it works great. Note that the part in my hand is a controller and the other controller is attached to the front. The front one can pop off and act as your left hand to reload and throw grenades.

It was a challenging print with five large pieces and two small along with screws and nuts to hold it together. However, it was super fun and it makes the game WAY more realistic. More on this later. I've also been experimenting with some new exotic filaments.

37b7b79b793db7b489b50496b1f5787a_preview_featured

Made an AdaFruit Cupcade Raspberry Pi MAME Arcade

My teenage nephew and I worked on a Cupcade a few months ago but it was his. I 3d printed and made a PiGrrl (Raspberry Pi GameBoy) last year, so I figured I'd make a Cupcade (Raspberry Pi tiny Multi-Arcade Machine Emulator) as well. It's also somewhat challenging but I never really had the time until vacation. You can get the plans and source many of the parts locally, or you can get a complete kit from Adafruit. I did the partial kit for cheaper without the plastic case, then had a local makerspace lasercut a $5 piece of clear acrylic.

Set up Alexa to talk to my Nightscout-based Blood Sugar system

I got a few Amazon Alexa "Echo Dot" devices, so now we have three around the house. I upgraded my Nightscout Site (this is the Azure-based system that that allows remote management and viewing of my blood sugar as a Type 1 Diabetic.

The most recent update of Nightscout added Alexa support. I headed over to https://developer.amazon.com and made a dev account and got it all working. It's pretty slick. I can ask it all kinds of things (as can my kids. They love to know about how I'm doing when I'm out of town.)

image

Here's a video of it working!

"Alexa, what's my blood sugar?" #Diabetes @nightscoutproj #video

A video posted by Scott Hanselman (@shanselman) on


Basically I've been just making stuff and fixing stuff around the house. I even sat in a café and read the news. Madness.

I wonder if I could do this full time? I guess that's called retirement. ;)


Sponsor: Big thanks to Octopus Deploy! Do you deploy the same application multiple times for each of your end customers? The team at Octopus have taken the pain out of multi-tenant deployments. Check out their latest 3.4 release



© 2016 Scott Hanselman. All rights reserved.
     

How to Style WordPress Navigation Menus

Do you want to customize your WordPress navigation menus to change their colors or appearance? Your WordPress theme handles the appearance of navigation menus on your site. You can easily customize it using CSS to meet your requirements. In this article, we will show you… Read More »

The post How to Style WordPress Navigation Menus appeared first on WPBeginner.

Do you want to customize your WordPress navigation menus to change their colors or appearance? Your WordPress theme handles the appearance of navigation menus on your site. You can easily customize it using CSS to meet your requirements. In this article, we will show you how to style WordPress navigation menus.

Style WordPress Menus

Method 1: Style WordPress Menus Using a Plugin

Your WordPress theme uses CSS to style navigation menus. Many beginners are not comfortable editing theme files or writing CSS on their own.

That’s when a WordPress menu styling plugin comes in handy. It saves you from editing theme files or writing any code.

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

CSS Hero is a premium WordPress plugin that allows you to design your own WordPress theme without writing a single line of code (No HTML or CSS required). See our CSS Hero review to learn more.

WPBeginner users can use use this CSS Hero Coupon to get 34% discount on their purchase.

Upon activation, you will be redirected to obtain your CSS Hero License key. Simply follow the on-screen instructions, and you will be redirected back to your site in a few clicks.

Now you need to click on the CSS Hero button in your WordPress admin toolbar.

Launch CSS Hero

CSS Hero offers a WYSIWYG (What you see is what you get) editor. Clicking on the button will take you to your website with a floating CSS Hero toolbar visible on screen.

CSS Hero toolbar

You need to click on the blue icon at the top to start editing.

Take your mouse to your navigation menu and CSS Hero will highlight it by showing borders around it. When you click on the highlighted navigation menu, it will show you the items you can edit.

Point and click your navigation menu in CSS Hero

In the screenshot above, it shows us menu item, menu navigation, navigation menu container, etc.

Let’s assume we want to change the text color of all items in the navigation menu. In that case, we will select menu navigation which affects entire menu.

CSS Hero will now show you different properties that you can edit like text, background, border, margins, padding, etc.

Editing navigation menu properties in CSS Hero

You can click any property that you want to change. CSS Hero will show you a simple interface where you can make your changes.

Editing navigation menu text color

In the screenshot above, we selected text, and it showed us a nice interface to select fonts, change text color, size, and other properties.

As you make changes, you will be able to see them live in the theme preview.

Preview live changes

Once you are satisfied with the changes, click on the save button in CSS Hero toolbar to save your changes.

The best thing about using this method is that you can easily undo any changes that you make. CSS Hero keeps a complete history of all your changes, and you can go back and forth between those changes.

Method 2: Manually Style WordPress Navigation Menus

This method requires you to edit your WordPress theme files. You should use it only if you are comfortable editing code and understand how WordPress themes work.

The best way to make customizations to your WordPress theme is by creating a child theme. If you are only changing CSS, then you can see our guide on how to easily add custom CSS in WordPress without changing your theme files.

WordPress navigation menus are displayed in an unordered list (bulleted list).

If you just used the following tag, then it will display a list with no CSS classes associated with it.

<?php wp_nav_menu(); ?>

Your unordered list would have the class name ‘menu’ with each list item having its own CSS class.

This might work if you have only one menu location. However, most themes have multiple locations where you can display navigation menus.

Using only the default CSS classes may cause conflict with menus on other locations.

This is why you need to define CSS class and menu location as well. Chances are that your WordPress theme is already doing that by adding the navigation menus using code like this:

<?php
	wp_nav_menu( array(
		'theme_location' => 'primary',
		'menu_class'     => 'primary-menu',
		 ) );
?>

This code tells WordPress that this is where the theme displays primary menu. It also adds a CSS class primary-menu to the navigation menu.

Now you can style your navigation menu using this CSS structure.

#header .primary-menu{} // container class
#header .primary-menu ul {} // container class first unordered list
#header .primary-menu ul ul {} //unordered list within an unordered list
#header .primary-menu li {} // each navigation item
#header .primary-menu li a {} // each navigation item anchor
#header .primary-menu li ul {} // unordered list if there is drop down items
#header .primary-menu li li {} // each drop down navigation item
#header .primary-menu li li a {} // each drap down navigation item anchor

Replace #header with the container class or ID used by your WordPress theme.

This structure will help you completely change the appearance of your navigation menu.

However, there are other classes that are automatically added by WordPress to each menu and menu item. These classes allow you to customize your navigation menu even further.

.current_page_item{} // Class for Current Page
.current-cat{} // Class for Current Category
.current-menu-item{} // Class for any other current Menu Item
.menu-item-type-taxonomy{} // Class for a Category
.menu-item-type-post_type{} // Class for Pages
.menu-item-type-custom{} // Class for any custom item that you added
.menu-item-home{} // Class for the Home Link

WordPress also allows you to add CSS classes to individual menu items from within admin area.

You can use this feature to style menu items, like adding image icons with your menus or by just changing colors to highlight a menu item.

Head over to Appearance » Menus page and click on the Screen Options button.

Enable CSS classes option in WordPress menus screen

Once you have checked that box, you will see that an additional field is added when you go to edit each individual menu item.

Adding a custom CSS class to a menu item in WordPress

Now you can use this CSS class in your stylesheet to add your custom CSS. It will only affect the menu item with the CSS class you added.

We hope this article helped you learn how to style WordPress navigation menus. You may also want to see our guide on how to add mobile-ready responsive WordPress menu.

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

The post How to Style WordPress Navigation Menus appeared first on WPBeginner.

Docker on a Synology NAS – Also running ASP.NET and .NET Core!

Docker on Synology is amazingI love my Synology NAS (Network Attached Storage) device. It has sat quietly in my server closet for almost 5 years now. It was a fantastic investment. I’ve filled it with 8TB of inexpensive Seagate Drives and it does its own flavor of RAID to give me roughly 5TB (which, for my house is effectively infinite) of storage. In my house it’s just \\SERVER or http://server. It’s a little GNU Linux machine that is easier to manage and maintain (and generally deal with) that just chills in the closet. It’s a personal cloud.

It also runs:

  • Plex – It’s a media server with over 15 years of home movies and photos. It’s even more magical when used with an Xbox One. It transcodes videos that then download to my Windows tablets or iPad…then I watch them offline on the plane.
  • VPN Server – I can remotely connect to my house. Even stream Netflix when I’m overseas.
  • Surveillance Station – It acts as a DVR and manages streams from a dozen cameras both inside and outside the house, scanning for motion and storing nearly a week of video.
  • Murmur/Mumble Server – Your own private VOIP chat service. Used for podcasts, gaming, private calls that aren’t over Skype, etc.
  • Cloud Sync/Backup – I have files in Google Drive, Dropbox, and OneDrive…but I have them entirely backed up on my Synology with their Cloud Sync.

51FvMne3PyL._SL1280_Every year my Synology gets better with software upgrades. The biggest and most significant upgrade to Synology has been the addition of Docker and the Docker ecosystem. There is first class support for Docker on Synology. There are some Synology devices that are cheaper and use ARM processors. Make sure you get one with an Intel processor for best compatibility. Get the best one you can and you’ll find new uses for it all the time! I have the 1511 (now 1515) and it’s amazing.

ASP.NET Core on Docker on Synology

A month ago Glenn Condron and I did a Microsoft Virtual Academy on Containers and Cross-Platform .NET (coming soon!) and we made this little app and put it in Docker. It’s “glennc/fancypants.” That means I can easily run it anywhere with just:

docker run glennc/fancypants

Sometimes a DockerFile for ASP.NET Core can be as basic as this:

FROM microsoft/aspnetcore:1.0.1
ENTRYPOINT ["dotnet", "WebApplication4.dll"]
ARG source=.
WORKDIR /app
EXPOSE 80
COPY $source .

You could certainly use Docker Compose and have your Synology running Redis, MySql, ASP.NET Core, whatever.

Even better, since Synology has such a great UI, here is Glenn’s app in the Synology web-based admin tool:

Docker on Synology - Node and ASP.NET Core Apps 

I can ssh into the Synology (you’ll need to SSH in as root, or you’ll want to set up Docker to allow another user to avoid this) and run docker commands directly, or I can use their excellent UI. It’s really one of the nicest Docker UIs I’ve seen. I was able to get ASP.NET Core and the Node.js Ghost blog running in minutes with modest RAM requirements.

image

Once Containers exist in Docker on Synology you can “turn them on and off” like any service.

ASP.NET Core on Docker on Synology

This also means that your Synology can now run any Docker-based service like a private version of GitLab (good instructions here)! You could then (if you like) do cool domain mappings like gitlab.hanselman.com:someport and have your Synology do the work. The Synology could then run Jenkins or Travis as well which makes my home server fit nicely into my development workflow without use any compute resources on my main machine (or using any cloud resource at all!)

The next step for me will be to connect to Docker running on Synology remotely from my Windows machine, then setup “F5 Docker Debugging” in Visual Studio.

image

Anyone else using a Synology?

* My Amazon links pay for tacos. Please use them.


Sponsor: Big thanks to Octopus Deploy! Do you deploy the same application multiple times for each of your end customers? The team at Octopus have taken the pain out of multi-tenant deployments. Check out their latest 3.4 release!


© 2016 Scott Hanselman. All rights reserved.
     

Docker on Synology is amazingI love my Synology NAS (Network Attached Storage) device. It has sat quietly in my server closet for almost 5 years now. It was a fantastic investment. I've filled it with 8TB of inexpensive Seagate Drives and it does its own flavor of RAID to give me roughly 5TB (which, for my house is effectively infinite) of storage. In my house it's just \\SERVER or http://server. It's a little GNU Linux machine that is easier to manage and maintain (and generally deal with) that just chills in the closet. It's a personal cloud.

It also runs:

  • Plex - It's a media server with over 15 years of home movies and photos. It's even more magical when used with an Xbox One. It transcodes videos that then download to my Windows tablets or iPad...then I watch them offline on the plane.
  • VPN Server - I can remotely connect to my house. Even stream Netflix when I'm overseas.
  • Surveillance Station - It acts as a DVR and manages streams from a dozen cameras both inside and outside the house, scanning for motion and storing nearly a week of video.
  • Murmur/Mumble Server - Your own private VOIP chat service. Used for podcasts, gaming, private calls that aren't over Skype, etc.
  • Cloud Sync/Backup - I have files in Google Drive, Dropbox, and OneDrive...but I have them entirely backed up on my Synology with their Cloud Sync.

51FvMne3PyL._SL1280_Every year my Synology gets better with software upgrades. The biggest and most significant upgrade to Synology has been the addition of Docker and the Docker ecosystem. There is first class support for Docker on Synology. There are some Synology devices that are cheaper and use ARM processors. Make sure you get one with an Intel processor for best compatibility. Get the best one you can and you'll find new uses for it all the time! I have the 1511 (now 1515) and it's amazing.

ASP.NET Core on Docker on Synology

A month ago Glenn Condron and I did a Microsoft Virtual Academy on Containers and Cross-Platform .NET (coming soon!) and we made this little app and put it in Docker. It's "glennc/fancypants." That means I can easily run it anywhere with just:

docker run glennc/fancypants

Sometimes a DockerFile for ASP.NET Core can be as basic as this:

FROM microsoft/aspnetcore:1.0.1

ENTRYPOINT ["dotnet", "WebApplication4.dll"]
ARG source=.
WORKDIR /app
EXPOSE 80
COPY $source .

You could certainly use Docker Compose and have your Synology running Redis, MySql, ASP.NET Core, whatever.

Even better, since Synology has such a great UI, here is Glenn's app in the Synology web-based admin tool:

Docker on Synology - Node and ASP.NET Core Apps 

I can ssh into the Synology (you'll need to SSH in as root, or you'll want to set up Docker to allow another user to avoid this) and run docker commands directly, or I can use their excellent UI. It's really one of the nicest Docker UIs I've seen. I was able to get ASP.NET Core and the Node.js Ghost blog running in minutes with modest RAM requirements.

image

Once Containers exist in Docker on Synology you can "turn them on and off" like any service.

ASP.NET Core on Docker on Synology

This also means that your Synology can now run any Docker-based service like a private version of GitLab (good instructions here)! You could then (if you like) do cool domain mappings like gitlab.hanselman.com:someport and have your Synology do the work. The Synology could then run Jenkins or Travis as well which makes my home server fit nicely into my development workflow without use any compute resources on my main machine (or using any cloud resource at all!)

The next step for me will be to connect to Docker running on Synology remotely from my Windows machine, then setup "F5 Docker Debugging" in Visual Studio.

image

Anyone else using a Synology?

* My Amazon links pay for tacos. Please use them.


Sponsor: Big thanks to Octopus Deploy! Do you deploy the same application multiple times for each of your end customers? The team at Octopus have taken the pain out of multi-tenant deployments. Check out their latest 3.4 release!


© 2016 Scott Hanselman. All rights reserved.
     

Docker on a Synology NAS – Also running ASP.NET and .NET Core!

Docker on Synology is amazingI love my Synology NAS (Network Attached Storage) device. It has sat quietly in my server closet for almost 5 years now. It was a fantastic investment. I’ve filled it with 8TB of inexpensive Seagate Drives and it does its own flavor of RAID to give me roughly 5TB (which, for my house is effectively infinite) of storage. In my house it’s just \\SERVER or http://server. It’s a little GNU Linux machine that is easier to manage and maintain (and generally deal with) that just chills in the closet. It’s a personal cloud.

It also runs:

  • Plex – It’s a media server with over 15 years of home movies and photos. It’s even more magical when used with an Xbox One. It transcodes videos that then download to my Windows tablets or iPad…then I watch them offline on the plane.
  • VPN Server – I can remotely connect to my house. Even stream Netflix when I’m overseas.
  • Surveillance Station – It acts as a DVR and manages streams from a dozen cameras both inside and outside the house, scanning for motion and storing nearly a week of video.
  • Murmur/Mumble Server – Your own private VOIP chat service. Used for podcasts, gaming, private calls that aren’t over Skype, etc.
  • Cloud Sync/Backup – I have files in Google Drive, Dropbox, and OneDrive…but I have them entirely backed up on my Synology with their Cloud Sync.

51FvMne3PyL._SL1280_Every year my Synology gets better with software upgrades. The biggest and most significant upgrade to Synology has been the addition of Docker and the Docker ecosystem. There is first class support for Docker on Synology. There are some Synology devices that are cheaper and use ARM processors. Make sure you get one with an Intel processor for best compatibility. Get the best one you can and you’ll find new uses for it all the time! I have the 1511 (now 1515) and it’s amazing.

ASP.NET Core on Docker on Synology

A month ago Glenn Condron and I did a Microsoft Virtual Academy on Containers and Cross-Platform .NET (coming soon!) and we made this little app and put it in Docker. It’s “glennc/fancypants.” That means I can easily run it anywhere with just:

docker run glennc/fancypants

Sometimes a DockerFile for ASP.NET Core can be as basic as this:

FROM microsoft/aspnetcore:1.0.1
ENTRYPOINT ["dotnet", "WebApplication4.dll"]
ARG source=.
WORKDIR /app
EXPOSE 80
COPY $source .

You could certainly use Docker Compose and have your Synology running Redis, MySql, ASP.NET Core, whatever.

Even better, since Synology has such a great UI, here is Glenn’s app in the Synology web-based admin tool:

Docker on Synology - Node and ASP.NET Core Apps 

I can ssh into the Synology (you’ll need to SSH in as root, or you’ll want to set up Docker to allow another user to avoid this) and run docker commands directly, or I can use their excellent UI. It’s really one of the nicest Docker UIs I’ve seen. I was able to get ASP.NET Core and the Node.js Ghost blog running in minutes with modest RAM requirements.

image

Once Containers exist in Docker on Synology you can “turn them on and off” like any service.

ASP.NET Core on Docker on Synology

This also means that your Synology can now run any Docker-based service like a private version of GitLab (good instructions here)! You could then (if you like) do cool domain mappings like gitlab.hanselman.com:someport and have your Synology do the work. The Synology could then run Jenkins or Travis as well which makes my home server fit nicely into my development workflow without use any compute resources on my main machine (or using any cloud resource at all!)

The next step for me will be to connect to Docker running on Synology remotely from my Windows machine, then setup “F5 Docker Debugging” in Visual Studio.

image

Anyone else using a Synology?

* My Amazon links pay for tacos. Please use them.


Sponsor: Big thanks to Octopus Deploy! Do you deploy the same application multiple times for each of your end customers? The team at Octopus have taken the pain out of multi-tenant deployments. Check out their latest 3.4 release!


© 2016 Scott Hanselman. All rights reserved.
     

Docker on Synology is amazingI love my Synology NAS (Network Attached Storage) device. It has sat quietly in my server closet for almost 5 years now. It was a fantastic investment. I've filled it with 8TB of inexpensive Seagate Drives and it does its own flavor of RAID to give me roughly 5TB (which, for my house is effectively infinite) of storage. In my house it's just \\SERVER or http://server. It's a little GNU Linux machine that is easier to manage and maintain (and generally deal with) that just chills in the closet. It's a personal cloud.

It also runs:

  • Plex - It's a media server with over 15 years of home movies and photos. It's even more magical when used with an Xbox One. It transcodes videos that then download to my Windows tablets or iPad...then I watch them offline on the plane.
  • VPN Server - I can remotely connect to my house. Even stream Netflix when I'm overseas.
  • Surveillance Station - It acts as a DVR and manages streams from a dozen cameras both inside and outside the house, scanning for motion and storing nearly a week of video.
  • Murmur/Mumble Server - Your own private VOIP chat service. Used for podcasts, gaming, private calls that aren't over Skype, etc.
  • Cloud Sync/Backup - I have files in Google Drive, Dropbox, and OneDrive...but I have them entirely backed up on my Synology with their Cloud Sync.

51FvMne3PyL._SL1280_Every year my Synology gets better with software upgrades. The biggest and most significant upgrade to Synology has been the addition of Docker and the Docker ecosystem. There is first class support for Docker on Synology. There are some Synology devices that are cheaper and use ARM processors. Make sure you get one with an Intel processor for best compatibility. Get the best one you can and you'll find new uses for it all the time! I have the 1511 (now 1515) and it's amazing.

ASP.NET Core on Docker on Synology

A month ago Glenn Condron and I did a Microsoft Virtual Academy on Containers and Cross-Platform .NET (coming soon!) and we made this little app and put it in Docker. It's "glennc/fancypants." That means I can easily run it anywhere with just:

docker run glennc/fancypants

Sometimes a DockerFile for ASP.NET Core can be as basic as this:

FROM microsoft/aspnetcore:1.0.1

ENTRYPOINT ["dotnet", "WebApplication4.dll"]
ARG source=.
WORKDIR /app
EXPOSE 80
COPY $source .

You could certainly use Docker Compose and have your Synology running Redis, MySql, ASP.NET Core, whatever.

Even better, since Synology has such a great UI, here is Glenn's app in the Synology web-based admin tool:

Docker on Synology - Node and ASP.NET Core Apps 

I can ssh into the Synology (you'll need to SSH in as root, or you'll want to set up Docker to allow another user to avoid this) and run docker commands directly, or I can use their excellent UI. It's really one of the nicest Docker UIs I've seen. I was able to get ASP.NET Core and the Node.js Ghost blog running in minutes with modest RAM requirements.

image

Once Containers exist in Docker on Synology you can "turn them on and off" like any service.

ASP.NET Core on Docker on Synology

This also means that your Synology can now run any Docker-based service like a private version of GitLab (good instructions here)! You could then (if you like) do cool domain mappings like gitlab.hanselman.com:someport and have your Synology do the work. The Synology could then run Jenkins or Travis as well which makes my home server fit nicely into my development workflow without use any compute resources on my main machine (or using any cloud resource at all!)

The next step for me will be to connect to Docker running on Synology remotely from my Windows machine, then setup "F5 Docker Debugging" in Visual Studio.

image

Anyone else using a Synology?

* My Amazon links pay for tacos. Please use them.


Sponsor: Big thanks to Octopus Deploy! Do you deploy the same application multiple times for each of your end customers? The team at Octopus have taken the pain out of multi-tenant deployments. Check out their latest 3.4 release!


© 2016 Scott Hanselman. All rights reserved.
     

How to Backup & Restore Your WordPress Site with UpdraftPlus

Backups are the first layer of security for any WordPress site. Aside from having automated backups, you also need to have an easy way to restore the backup if needed. In this article, we will show you how to easily backup and restore your WordPress… Read More »

The post How to Backup & Restore Your WordPress Site with UpdraftPlus appeared first on WPBeginner.

Backups are the first layer of security for any WordPress site. Aside from having automated backups, you also need to have an easy way to restore the backup if needed. In this article, we will show you how to easily backup and restore your WordPress site with UpdraftPlus.

UpdraftPlus

Why You Need a Backup & Restore Solution for WordPress?

Research shows that data loss and downtime cost $1.7 trillion each year to the globally economy.

All websites on the internet are vulnerable to data loss and security threats. As a website owner, these are some common scenarios when you may lose your data:

  • Your website can get hacked and hackers may destroy your data.
  • Your hosting provider can lose your data
  • Your host reserves the right to terminate your account and delete all your data.

There are many other scenarios where you could end up losing your website and all the valuable data created over the years.

The best way to protect yourself against these threats is to regularly backup your WordPress site.

WordPress does not come with a built-in backup solution. However, there are several great WordPress backup plugins which allow you to automatically backup and restore your WordPress site.

UpdraftPlus is one of the best WordPress backup plugins. It allows you to setup automatic backup schedules. It will also help you restore your WordPress site in case something bad happens.

Having said that, let’s take a look at how to easily backup and restore your WordPress site with UpdraftPlus.

Creating WordPress Backup with UpdraftPlus

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

Upon activation, you need to visit Settings » UpdraftPlus Backups page to configure plugin settings.

Settings page UpdraftPlus

Now you need to click on the settings tab.

This is where you will set up an automatic backup schedule and a remote location to store your backups.

UpdraftPlus settings

First you need to choose a backup schedule for your files. Files include your WordPress themes, plugins, images and other uploads.

After that you need to select a backup schedule for your WordPress database. WordPress is a database driven software. All your posts and pages, comments, website settings, are stored in the database.

Your backup schedule should be based on how often you add new content to your website.

For example, If you add two blog posts each week, then you can select a fortnightly backup of files and weekly backup of database.

Next, you need to choose where to store your backup files.

It is a bad idea to save your backups on the same location as your website. Losing your website, means you will also lose access to your backup files.

This is why you need to choose a remote cloud storage service to store your backups.

UpdraftPlus allows you to save your backups to several cloud storage services including Dropbox, Google Drive, Microsoft OneDrive, any many others. You can also send your backups to an email address.

Simply click on a remote service to select it, and you will see setup instructions below.

For the sake of this tutorial, we will show you how to use Dropbox as your remote backup storage service with UpdraftPlus.

We will go ahead and click on Dropbox to select it and then scroll down to the bottom of the page and click on the save changes button.

UpdraftPlus will save your settings. However, you still need to give UpdraftPlus access to your Dropbox account.

Scroll down to remote storage setup instructions and click on the link next to ‘Authenticate with Dropbox’ option.

Setting up Dropbox as your remote storage service for backups

The link will take you to the Dropbox website where you will be asked to sign-in using your Dropbox email and password.

After login, you will be asked if you want to allow UpdraftPlus to access your Dropbox account.

Allow UpdraftPlus to access Dropbox

UpdraftPlus will only have permission to access its own folder in ‘Apps » UpdraftPlus” folder. Click on ‘Allow’ button to continue.

You will be redirected to UpdraftPlus website where you need to click on ‘Complete Setup’ button to finish setup.

Complete setup

You will now be taken back to your WordPress site, and you will see the UpdraftPlus settings page again. Scroll down to the bottom of the page and click on the Save Changes button.

You have now setup backup schedule and remote location to store your backups.

Creating Manual WordPress Backups with UpdraftPlus

UpdraftPlus can automatically create backups based on the schedule you selected earlier. However, you can also manually create backups any time you want.

First you need to visit Settings » UpdraftPlus Backups and click on ‘Backup Now’ button.

Creating a manual backup with UpdraftPlus

This will bring up a pop-up with options to select files/database backup and whether you want to send the backup to remote storage. (see which WordPress files should you backup?)

Manual backup

Click on the ‘Backup Now’ button to continue.

UpdraftPlus will now start creating backup of your files and database. You will be able to see the progress on the settings page.

Backup Progress

The process may take a while depending on the size of your website.

UpdraftPlus will also start uploading your backup files to the remote location.

Restoring Your WordPress Backup with UpdraftPlus

Creating backups is easy, but the real useful part about backups is the ability to restore them with the same ease.

UpdraftPlus makes it easy to restore your WordPress site from a backup.

If your WordPress site was hacked or you want to start fresh, then first you will need to delete everything and install WordPress again.

Next, you will need to install and activate the UpdraftPlus plugin again on your fresh new WordPress site.

Upon activation, you need to visit Settings » UpdraftPlus Backups page and click on Restore button.

This will bring you to the backups page. UpdraftPlus will scan your server to see if it can find an existing backup in /wp-content/updraft/ folder on your website.

However, since you deleted everything from your website it will not be able to find the backup files.

If you saved the backup files on your computer, then you can click on ‘Upload backup files’ link to manually upload and restore them.

Upload backup files manually

You can also connect UpdraftPlus to remote location (Dropbox, Google Drive, etc). This way UpdraftPlus will be able to scan remote location and use your previously stored backups.

Click on the Settings tab and then choose the remote location you used earlier to store your backups.

Reconnect remote storage location

Follow the instructions to authenticate your website with the remote storage service.

Don’t forget to click on the ‘Save Changes’ button at the bottom of the page to restore your settings.

Now you can switch back to ‘Existing Backups’ tab and click on the ‘Rescan remote location’ link.

Remote backups

UpdraftPlus will now look for backups in the remote storage location and display them below.

You can now click on the restore button next to a backup.

UpdraftPlus will now ask you what you would like to restore. You need to select all options and then click ‘Restore’ button.

Restore options

UpdraftPlus will now fetch your backup files from the remote location and start restoring your site from the backup.

Our UpdraftPlus Review

UpdraftPlus is a powerful WordPress backup plugin, and it’s a great option for DIY users who want the flexibility to choose their backup schedule and remote storage location.

Because UpdraftPlus is free, it’s a popular choice among users. However you can upgrade to UpdraftPlus Premium to access premium addons such as Website Migrator, UpdraftVault, priority support, and molre options. The premium option costs $70 per year.

However like most WordPress backup plugins, UpdraftPlus lacks the ability to do realtime backups of your website.

If you want real-time backups, unlimited storage, and don’t want to pay a third-party storage service like Dropbox, then we recommend using VaultPress instead. This is what we use on WPBeginner.

The downside of VaultPress is cost. The real-time backup plan for one site costs $165 per year which is more than twice UpdraftPlus premium which gets you access for two sites and obviously a non-comparison with the free version.

Final Thoughts

Backups allow you to recover your website in an emergency. However, they cannot protect your website against common security threats like hacking, malware, code injection, etc.

At WPBeginner, we use Sucuri to protect our site (see how Sucuri helped us block 450,000 WordPress attacks).

You need to make sure that your WordPress site is secure. Follow the instructions in our ultimate WordPress security guide to strengthen your WordPress security.

That’s all, we hope this article helped you easily backup and restore WordPress sites with UpdraftPlus.

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 Backup & Restore Your WordPress Site with UpdraftPlus appeared first on WPBeginner.

How to Change Custom Post Type Permalinks in WordPress

Recently, one of our readers asked if it was possible to change the custom post type permalink structure in WordPress. By default, you can change the permalink structure of WordPress posts, but not custom post types. In this article, we will show you how to… Read More »

The post How to Change Custom Post Type Permalinks in WordPress appeared first on WPBeginner.

Recently, one of our readers asked if it was possible to change the custom post type permalink structure in WordPress. By default, you can change the permalink structure of WordPress posts, but not custom post types. In this article, we will show you how to change custom post type permalinks in WordPress.

How to change custom post type permalinks in WordPress

Why Change Custom Post Type Permalinks in WordPress?

WordPress uses SEO friendly URL structure which makes your WordPress URLs readable and search engine friendly. These SEO friendly URLs are called permalinks.

You can customize permalinks by visiting Settings » Permalinks page. However, you will notice that you can only change permalink structure for blog posts.

Permalink settings page in WordPress

If you are using custom post types or custom taxonomies on your website, then WordPress will use default permalink structure for those.

For example, if you have a custom post type called ‘Movies’, then its URL structure will look like this:

http://example.com/movies/the-force-awakens/

If your custom post type has archives enabled, then the archive page URL will look like this:

http://example.com/movies/

This URL scheme is quite SEO friendly and in most cases you don’t need to change it. However, sometimes you may want to customize it to meet your own needs.

Having said that, let’s see how you can easily customize custom post type permalink structure in WordPress.

Changing Custom Post Type Permalinks in WordPress

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

Upon activation, you need to visit Settings » Permalinks page and scroll down to ‘Permalink Settings for Custom Post Types’ section.

Custom post types permalinks

Here you can change the permalink structure of single items in your custom post type.

You can use all the standard WordPress permalink tags. For a complete list of available tags, see our article on using SEO friendly URL structure in WordPress.

Let’s assume that you want to use post ID instead of post name in the URL. In that case all you need to do is add this tag:

/%post_id%/

Notice the trailing slashes at the beginning and end of the tag. These trailing slashes are the separators, and without them your permalinks will not work.

Adding tags to customize custom post type permalinks

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

Now the permalinks for a single item in your custom post type will look like this:

http://example.com/movies/133/

The number in the URL will be the numeric ID of the post in your WordPress database.

Let’s take a look at another example.

Let’s say you want to add /year/ before the post name in URL. In that case, you will use these tags:

/%year%/%post_name%/

Click on the save changes button to update your permalinks.

Now the single item permalink for your custom post type will look like this:

http://example.com/movies/2016/the-force-awakens/

So far so good. Now let’s try another example.

Let’s assume that you are using a custom taxonomy called ‘genre’ with your custom post type ‘movies’ and you want to add the custom taxonomy term into the URL. In that case, you will use these tags:

/%genre%/%post_name%/

In this example, genre is the slug of our custom taxonomy.

Click on the save changes button to update your permalinks.

Now the single item permalink for your custom post type will look like this:

http://example.com/movies/sci-fi/the-force-awakens/

That’s all, we hope this article helped you learn how to easily change custom post type permalinks in WordPress. You may also want to see our list of 12 most useful WordPress custom post types tutorials.

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 Change Custom Post Type Permalinks in WordPress appeared first on WPBeginner.