Using an SVG Icon for a WordPress Custom Post Type

When creating a Custom Post Type in WordPress there is a convenient way to select a custom icon when registering the post type. WordPress comes with a set of built-in icons called Dashicons that have easy names that can be used for your menu_icon property: Having these icons at hand is great. Unfortunately, I often…

Creating a Rewrite Rule in WordPress

Recently I had to create an endpoint for users to view a dynamically-generated PDF on a site. I wanted to have a nice-looking URL for users. I found it difficult to wrap my head around the process of adding a rewrite rule in WordPress but I finally figured it out. WordPress offers a function, add_rewrite_rule,…