Great for drop downs, fly outs, and mobile menus.Read More
It’s unfortunate that the Time Field in Gravity Forms does not have more custom options available.
Contrarily, the Date Field, allows for a calendar icon, and drop downs, but the Time Field doesn’t have a default placeholder option to populate the current time, or an alternate view to allow for drop downs showing 12 or 24 hour time.
So I had to turn to jQuery…Read More
Below is an example of the_post_navigation customized to include an image and custom text for previous and next.
Add this snippet to your functions file, link to your images, and then call it where you would like the_post_navigation to appear.Read More
I use this fairly often. I find working with plugins I already have installed is better than installing additional plugins to resolve the issue I’m trying to accomplish more reliable.Read More
Add this to wp-config.php if you’re unable to perform updates on your WordPress installation.
First check that your folder permissions are correct, and there are not any plugins installed, or prompts within wp-config.php that will prevent updates or installations from being performed.Read More
March 21, 2018
Use the below example to custom format the date displayed when querying Tribe events.Read More
Comes in handy if you have items saved in a Plugin’s additional folders that you’d like to only be accessible to your paid / subscribed users.Read More
If you’re offering free downloadable items on your website, and don’t require site visitors to register for access to the items, you can use the following snippet to add a download link to your single-product template.Read More
I’ve been running into “Uncaught referenceError: jQuery is not defined” a lot lately when working with scripts and plugins that I’ve used for years. It’s unbelievably annoying to have something that’s worked one way for most of my career to suddenly stop working and bring up errors.
Nonetheless, I’ve found a solution!Read More
February 21, 2018
Use ‘eventDisplay’ => ‘list’ in conjunction with the WordPress backend Settings for Tribe Events Calendar to prevent recurring events from showing up in custom loops.Read More
February 14, 2018
If your website has several News / Blog contributors, you can display a list of Authors by role and link back to their individual landing pages (author.php).Read More
WordPress has so many different “stock” template types that are not used on every type of website. For example, a small business website, may not use the Archive, Blog or Single page layouts.
In my seven years of building WordPress website, I have yet to come across a single client that uses the “Attachment Page” layout (properly, at least).Read More
Typically, I use classes like .desktop, .tablet, and .mobile combined with media queries to switch between different-sized elements when building a website, in order to avoid loading the high resolution images on the handheld devices.
I find the class method a little tedious, and not as intuitive as I would like, so I’ve been looking for alternate ways to perform these transitions.Read More
I hate anchor tags, and I hate even more that there isn’t an easy point / click way for them to be added into a website using the WordPress editor.
Nonetheless, clients request them a lot, and they don’t like the “jumping” that they cause when the anchor links are on the same page.Read More
November 08, 2017
November 01, 2017
If you have transitioning content on your website, such as a Templated Page that will be launching at a certain date or time, you can setup a custom countdown landing container, and use a custom field to automatically update the content at a scheduled date and time.Read More
Another way to style images dynamically based on window sizes is shown below.
If you’re using images that are set to a 2:1 ratio (where width is two times greater than the height), you can use the example below to dynamically scale the height of the containers as windows are loaded / resized.Read More
September 29, 2017
Tribe Events Calendar is a very user friendly plugin, and I highly recommend it for WordPress beginners.
Within the WordPress backend, Tribe’s settings and posts do not have an option to customize the Website URL, Organizer URL, and Venue URL to make them open in new windows.Read More
Building custom menus and filters is unavoidable. If you’re not comfortable triggering the active item with jQuery to add an active class, you can find the current page ID, and use existing WordPress CSS classes to reapply styles already within your stylesheet.Read More
Sometimes, when working with designers, the content of a multilingual website will end up on a single landing page. In this event, using suppress_filters to get_posts associated with the active language will provide posts in both languages, and not provide the side-by-side translation effect desired.Read More
I work with Gravity Forms, and Gravity Forms User Registration a lot, so being able to redirect users to a custom template instead of a front end user profile (such as Theme My Login) would be preferred.
With Gravity Forms, I’m able to enable custom notifications based on the fields that are updated.Read More
I recently worked in a website that had multiple skins within a single domain. The different themes were controlled and activated by their related parent pages. I’ve already gone over how to add an ancestor class to the body, but I needed to add a couple additional features to this website as well.Read More
<?php $tax_slug = get_query_var( 'taxonomy_category' ); ?>
Tribe Events Calendar is a great plugin, that has a lot of very simple queries you can use to create calendar feeds within your templates.
If you have an event on your website, and a calendar that’s launching before weeks (or even months) before the event is taking place, you can use a function to setup a start date for your calendar. The Calendar’s default page views (month, day, list) will load starting from the date entered in the function.Read More
A deep number of page levels in a website can make navigation difficult for front end users. In addition to breadcrumbs, it is worthwhile to maintain your Top-Most Page Title in all areas to help your visitors find their way between the hierarchical sections of your site.Read More
Use this foreach loop (inside of a query) to grab Product galleries from WooCommerce.Read More
Sometimes Custom Post Types are built to organize and filter information, such as creating a Research archive or a Staff directory. That content is meant to be seen on the front end in the single.php template.
However, when creating a Custom Post Type for a rotating Banner, or a single page listing all of your Testimonials, the single.php template is moot.Read More
April 05, 2017
The All in One Event Calendar by Time.ly is extremely flexible if you need to place several widgets and event shortcodes on your website.
Using the Plugin to generate your own custom query and feeds of your Event information is not very intuitive, and finding valid information a long process.Read More
This is a continued modification of my earlier post for toggling multiple embedded YouTube videos into a larger playing div.
Since I was already using Posts to embed the videos, enabling a Featured Image for a Poster, and using the Content editor for a text overlay was a simple feat to accomplish.Read More
Using buttons and jQuery to filter and sort Posts on a website can be fun! Unfortunately, as your content grows, it can also become space consuming, and difficult to read.
Convert a list to a dropdown, and toggle the display of the items via class with a jQuery function.Read More
December 28, 2016
Gravity Forms is a powerful plugin!
Using this function, display values in the select dropdown field dynamically, based on parameters you set in the foreach loop.Read More
December 07, 2016
Sometimes when building arrays for directories, or archives, we have to list all of the content (even the empty ones).
In the unfortunate circumstance when you have no choice but to use the foreach loop, here is a handy workaround to check if the loop is empty, and display a custom messageRead More
Re-skinning live sites can be tricky and sometimes unavoidable.
I use the following snipped to target updated versions of stylesheets, headers and footers, and lock them to my user ID so all of the changes are only visible to myself until the theme is ready to launch.Read More
November 16, 2016
This snippet will allow the Single product layout to display in the same layout as your installed theme.Read More
This is a great way to get trigger content loading on the page automatically. Visitors can then use filters enabled in the Search Filter to customize their search.Read More
By default, Category templates bring in the words “Category Archives:” ahead of the category name with most themes, and this isn’t always ideal. When theming Archives separately from Category pages, it’s necessary to target the title of Category to edit the default text.Read More
Can be used to apply a smoke / fog effect to a div as a background, or using canvas. Includes support for modern browsers (will slow down page loading).Read More
You can achieve more stylistic versatility within your WordPress backend, and theme, if you’re able to inject fonts within the WYSIWYG editor.
This is possible if you are using embedded fonts, or if you are using fonts from a hosted library using the below function, and the Advanced TinyMCE plugin addon.Read More
Useful snippet to gather additional information about site visitors for forms that do not capture a lot of data.
Will honour user settings if IP address is set to private or reserved.Read More
Creating dynamic layouts can make it easier on your clients (and yourself) to update your content without worrying about checking the front end to make sure the selections are correct, or having to update various posts / content areas following updating new content.
The following example shows how to add a colour class to your container using the_loop, php and with some CSS adjustments, possibilities are endless!Read More
April 14, 2016
A useful addendum to queries when multiple products / post types are going to be featured with the same / similar names. This will prevent the need to add alphanumeric differential identifiers to the titles, and the links, slugs or categories assigned to the content can be used to divide up the information accordingly.Read More
January 22, 2016
November 23, 2015
Sub-navigation must be in a containerRead More
November 20, 2015
November 12, 2015
Alternative: echo wpautop(get_field(‘featured_summary’));Read More
September 09, 2015
This is a blanket solution that will help you hide the admin bar for everyone, and save time with having to provide the “hide toolbar” info to all users.Read More
Sometimes transitional content is used in one area of a website, like to display hours in a Header or Sidebar. Instead of having the client (or yourself!) update this content every day, get your code to update it for you when the weekdays change.Read More
August 18, 2015
Drop the below if statement within a loop and add a count for each colour change that you need with the template.
This is a great example to reference if you’re building a scrolling website, and loading all pages in a single progression with alternating templates applied.Read More
These handy two lines of code can prevent the Plugins submenu from being accessed within WordPress. All users (including Administrators) will no longer have permission to add, edit, or see the update notifications for installed Plugins.
Comes in handy for sites run by Clients that have a lot of plugin customization.Read More
echo apply_filters('the_content', get_post_field('post_content', $post_id));
Update – July 28, 2015
This method can also be used to retrieve data from custom fields when working with plugins like Advanced Custom Fields:
echo apply_filters('widget_content', get_post_field('widget_content', $post->ID));
Sometimes it’s handy to utilize the same features that are available within the Posts area, inside of your Pages. Adding the Excerpt to the Pages, provides you with an additional, native field to pull data from and take advantage of when building your WordPress website.Read More
February 11, 2015
Using large sliding banners with linked content can be both a blessing and a curse. This adds a beautiful level of style and information to the site, but also takes up a lot of space, and provides a lot of repetitive information that can be difficult for new visitors to navigate.Read More
I recently needed to create a dynamic table for a visual aesthetic. A few background images had been strategically placed alongside the content, and the grid provided structure and flow. Using this bit of code, I was able to target a div to populate an empty table, and style it accordingly.Read More
Embedded fonts that are being loaded from a server / another website, or file, will sometimes load after the main css file, and after the page is loaded, resulting in a weird display. Typekit fonts can be loaded faster using a timeout script.Read More
Using the_date(); this is very easy to achieve, all you need is © to get yourself setup. To take it a step further, you can include a date span, so your clients are aware of just how long you’ve been burning the midnight oil.
<p>© 2013 <?php date('Y') == "2012" ? $year = "" : $year = "- ".date('Y'); echo $year; ?></p>
Sourced here.Read More
WordPress keep redirecting me to the login page, even though I’ve entered my username and password correctly, several times. Check the address bar for this information after wp-login:
Remove it, and press enter. You will still be at the login screen, and yes, will have to login again, but there will no longer be a redirect loop taking place.Read More
When Themes are upgraded in Shopify, script libraries are upgraded. Depending on the level of expertise of the individual that developed your Theme, this means errors can arise. If your mobile navigation stops working, you may need to find your scripts.js.liquid file and look for errors in syntax and coding. Check your console to be sure which file you should edit, and always make a back up!Read More
November 06, 2014
October 20, 2014
October 15, 2014
Place this within the single.php template to grab the Featured Image and format it automatically inline with the content.
the_post_thumbnail('large', array('class' => 'alignright'));
This can also be used in the loop with alongside posts with featured images.Read More
Ever been hacked or had a change of staff and completely lose access to the website you’ve put so much time and effort into? The following code goes a long way, if you drop this into your sql through phpMyAdmin, this will create an Administrator account, granting you access to your website once again.Read More
September 24, 2014
Customize the output to match your theme.Read More
Sometimes fixing iframe and YouTube embed issues can be as simple as adding wmode=transparent to the iframe src string <iframe scr”http://youtube.com/embed/link_to_video” wmode=”transparent”></iframe> Other times, you may need to change this to wmode=”Opaque” If you’re still experiencing issues with drop down menus appearing behind iframes, and z-index is being ignored, the following code will come in handy.Read More
IFrames can be difficult to customize. If you want to add a border, or a box shadow to them, it can be simpler to do so if you wrap them in a parent div, and apply the necessary changes to this container. Border-radius will work with a parent div, when you couple it with overflow: hidden; forcing the clipping of the contained elements, and giving the illusion of the effect you’re looking for.Read More
Often, the WordPress Plugin Multiple Post Thumbnails is used within the page.php and single.php templates, and few conflicts arise. If you’re calling your thumbnails within header.php, footer.php or functions.php, the following code will help sort out issues with images not displaying via the simpler methods.Read More
I’ve run into problems several times where exclude and include do not work, or work selectively, and as a result, either all of the posts are included, or none of them are. I’ve found an answer that works both inside and outside of the loop.Read More
Background-Attachment: Fixed does not work in Safari when using multiple background images in Safari. The images will disappear when the browser is resized, or accessed in mobile device. Background-Attachment: Fixed will render the images properly in Chrome, and Firefox, but even when coupled with Display: Block, and Overflow: Hidden to force images to appear, will not work properly in Safari.Read More
Add suppress_filters => 0 to your get_posts(); argument and everything will be just fine!!!Read More
The Photoshop Scratch Disk is your hard drive where Photoshop is installed. Photoshop uses your hard drive as temporary “swap” space, or virtual memory, when your system does not have enough RAM to perform an operation. This can become “full” if Photoshop crashes and/or several temporary files have been created by Photoshop and not cleared out properly.Read More