m
  • Blog
  • About
  • Contact
  • Blog
  • About
  • Contact

Blog

Display WooThemes Testimonials Avatar before Quote

November 1, 2015

By default, the WooThemes Testimonials WordPress plugin displays the quote, then the avatar (author’s image), then the attribution (name, title and url). You can use the following filter to display the avatar before the quote: View the code on Gist. You can also change the order of the attribution in relation to the avatar and quote […]

No comments a

Bundle Load Testing with a Project

September 29, 2015

If you need to be able to run load tests on a project, but don’t want each developer to have to install something like Siege on their own computers in order to run them, you’ve come to the right place. I’ll outline how to bundle load testing functionality with a project. We’ll make use of an […]

No comments a

Clear Selectize Control on Dropdown Click

September 16, 2015

If you’re using Selectize to power your dropdown menus, you may find yourself wishing that when the user clicks the dropdown menu, the current value in the control would be cleared, leaving behind only a blinking cursor and the dropdown menu. This would make it very clear that the two options available to them are […]

2 comments a

Replace Post Meta Query with Taxonomy Query

September 6, 2015

In this post, I’ll cover how to replace a post meta query with a taxonomy query. Why, you ask? WordPress’ postmeta database table is not optimized for queries, so querying for posts based on their post meta like the below is inefficient. View the code on Gist. A much more efficient way to do this is […]

No comments a

Change WordPress Customizer Control Value Programmatically

September 3, 2015

Since the WordPress Customizer is built using the Underscore.js and Backbone.js libraries, the values of all the customizer controls are not stored in the DOM, but rather in a discrete model. This means that if you use JavaScript to change the value of a control in the DOM, it will look like it has changed visually, […]

No comments a

Rename Custom Post Type in WordPress

August 28, 2015

If you simply want to change how a post type is displayed in the WordPress admin, you can simply change its labels, or use a plugin like this one to do it for you. If on the other hand you need to rename the post type’s slug for some technical reason, then you can follow the […]

No comments a

Set up PHP CodeSniffer in PhpStorm with WordPress Coding Standards

August 11, 2015

The steps below cover how to set up PHP CodeSniffer in PhpStorm with WordPress Coding Standards rulesets. This can be very helpful for identifying violations of the WP coding standards as you write code, so you can fix them on-the-spot. This guide assumes you’re on Mac OS X or Linux, are using Vagrant for local […]

5 comments a

Vagrant Not Reachable After Disconnecting from VPN

July 22, 2015

If Vagrant is not reachable after disconnecting from a VPN, first run these commands to bring the interface down, then back up: sudo ifconfig vboxnet0 down sudo ifconfig vboxnet0 up   For a long term solution, consider adding the code below to the Vagrantfile, which will use the host as DNS: config.vm.provider :virtualbox do |vb| vb.customize [“modifyvm”, :id, […]

2 comments a

Get Images from Remote Server by Proxy

July 17, 2015

If you have the files and database you need to work on a WordPress site locally but not the images and other media, how can you get them from the remote server? For small sites, simply downloading the entire wp-content/uploads/ directory may be the easiest and quickest solution. For large sites, however, it’s a much better idea to […]

1 comment a

Get Permalink of Page Outside of The Loop

July 17, 2015

Let’s say you have some WordPress code that’s looping through all your posts and outputting some of their data to the webpage. How would you get the permalink of the page outside of The Loop (as in, what’s in the browser’s address bar) rather than the post you’re currently looping through? Typically you can use […]

3 comments a

Create a Taxonomy Dropdown in WordPress

June 25, 2015

In this post, I’ll outline how to create a taxonomy dropdown in WordPress that lets the user choose an option, then reloads the page to only show entries that match the taxonomy term they chose. This is extremely useful for filtering a list of results to show only what your visitor is interesting in seeing. Let’s […]

12 comments a

Require Post Title for Custom Post Type

June 23, 2015

In this post, I’ll outline how to make the post title field required for a custom post type in WordPress. By default, if a user leaves the title field blank, WordPress will still allow the post to be published or updated. What we want to do is prevent the custom post type from being published/updated […]

10 comments a
  • 1
  • 2
  • 3
  • 4
  • 5

Latest posts

  • thumb

    Get Term Being Edited on term.php WordPress Admin Page

    April 3, 2018

  • thumb

    Get Menu Modified Date in WordPress

    February 23, 2018

  • thumb

    Download and Insert a Remote Image File into the WordPress Media Library

    February 21, 2018

Tags

admin advanced custom fields backbone capabilities code sniffer coding standards customizer custom post type database dropdown edit slug javascript load test multisite MySQL nginx node npm permalink phpstorm plugin post meta post type role selectize sideload slug ssl taxonomy underscore user vpn vvv woocommerce WP-CLI wproundtable wp_query

Search

© 2016 Kellen Mace