Comprehensive HubSpot CMS Review vs. WordPress

Category: Common Questions

One of the most critical decisions for a business is where to host its website, and a CMS or content management system is a crucial component. Some companies with an internal IT team prefer to self-host their CMS using open-source software like WordPress because they require higher-level security or business integrations. However, a growing trend… Read more »

Continue Reading

Embed HubSpot Form in WordPress, Customize CSS, and Hide Fieldset Margins on Hidden Fields [code snippet]

Category: Code Snippets

When you embed a HubSpot form on an external site you can add css: ‘ ‘ to the embed code to remove the default form styles. If you have hidden fields the fieldset could have a margin or padding applied from your website stylesheet. This is common because you want a fieldset to have some… Read more »

Continue Reading

WooCommerce Product Category and Terms Select Filters [code snippet]

Category: Code Snippets

The code below will help you add a form select filter for Woocommerce online shop on WordPress. <?php $categories = get_terms( [‘taxonomy’ => ‘product_cat’, ‘hide_empty’ => true] ); ?> <div class=”product-categories”> <h3>Categories</h3> <select class=”form-control shop-filter” onchange=”location = this.value;”> <option selected value=”/shop/”>All</option> <?php foreach ( $categories as $category ) { ?> <option value=”<?php echo get_term_link( $category->term_id… Read more »

Continue Reading

Add Custom Info Widget to WordPress Admin Dashboard [code snippet]

Category: Code Snippets

The snippet below helps you customize the default WordPress admin dashboard. Sometimes the dashboard contains too much information and you want to simplify it for you or your clients. The code below will help you hide existing widgets and add a custom one. In this example I added a user guide to help new users… Read more »

Continue Reading

How to Redirect WWW to non WWW WordPress [htaccess snippet]

Category: Code Snippets

Below are two code recipes for your htaccess file to redirect different versions of your domain. Once you have things added you can use this redirect testing tool to verify all the versions of your domain are redirecting properly.

Continue Reading

Scale Up and Crop an Image WordPress [code snippet]

Category: Code Snippets

In WordPress you may need to increase the size of all thumbnails but WordPress does not res up the images to prevent distortion. Using the method outlined in this example you can use object-fit to make undersized images fit your desired aspect ratio. .img-crop__polyfill image is sized to the desired dimensions. This will help keep… Read more »

Continue Reading

How to Get a List of WordPress PDF, Image, Post, or Page URLS

Category: Code Snippets

Below are two PHP scripts you can use to help get a list of URLs of content in your WordPress site. I use these when I am migrating posts or media library files to another sites without using a plugin. Follow the steps below to use these scripts Open a text editor and copy and… Read more »

Continue Reading

How to Redirect Known Pages and Wildcard for Everything Else with htaccess

Category: Code Snippets

I recently worked on a project which needed me to shut down a WordPress blog and migrate it’s content. I had about 20 posts and pages that were going to migrate but everything else was going to be deleted. Since htaccess runs their commands from the top to the bottom, place your known redirects above… Read more »

Continue Reading

Restrict Certain File Mime Types in WordPress

Category: Common Questions

I recently heard from a client saying their blog was loading very slowly. The issue was caused from a high resolution image in .tiff format which is generally used for print. In order to block these file types add the following plugin to your mu-plugins folder. Source <?php /* prevent uploading of .tif files. https://wordpress.stackexchange.com/questions/44777/upload-mimes-filter-has-no-effect… Read more »

Continue Reading

Check Page Level Depth If Condition in WordPress

Category: Code Snippets

The code snippet below is handy when you are trying to check if the current page is a parent or a child in a WordPress theme. You can then use the conditional to output different code depending on the page depth it is <?php // gets page depth global $wp_query; $object = $wp_query->get_queried_object(); $parent_id =… Read more »

Continue Reading