- I didn’t actually try this one (misdirection!) but it could be your issue. Shared hosting can block access to the
/xmlrpc.php
file. This plugin can help you get around that.
https://wordpress.org/plugins/rename-xml-rpc/
Be sure to also follow the installation instructions: https://wordpress.org/plugins/rename-xml-rpc/#installation php-xmlrpc
is not installed.sudo apt-get install php-xmlrpc
. Thensudo service apache2 restart
. Not my issue, but kept on looking.php-xml
not installed.sudo apt-get install php-xml
. Thensudo service apache2 restart
. This was my issue!
Enabling mod_headers and CORS with Apache2
I’ve been working on a project and wanted to test out accessing media from a different domain using CORS. There’s two steps to this. Make sure you have Apache mod_headers enabled. Use apachectl -M on the command line interface and review the results. It should include something like this: headers_module (shared). If not then run … Continued
Keep Jetpacks Markdown Block from Being Filtered Out in get_the_excerpt
Run Shortcode in WordPress Excerpts
Add this to your functions.php
or your plugin.
add_filter( 'get_the_excerpt', 'shortcode_unautop');
add_filter( 'get_the_excerpt', 'do_shortcode');
add_filter( 'get_the_excerpt', 'do_shortcode', 5 );
How to disable not hide a field hidden by ACF conditional logic
Advanced Custom Fields — Update a Group Sub Field From Within a Flexible Content Field
$sub_fields = array( array('GROUPFIELDNAME' => array('GROUPSUBFIELDNAME' => $GROUPSUBFIELDVALUE), 'acf_fc_layout' => 'FLEXIBLECONTENTNAME') ); update_field('field_59778f7a4af43', $sub_fields, $post->ID);
Moving a site from Drupal to WordPress

Exporting from Drupal Use Views Data Export module and these instructions. When exporting tags there’s a couple options. 1. You can have all the added tags in one field value. 2. You can export each taxonomy individually. Depending on how you want the tags within the WP site you may prefer one way or another. … Continued
Mirroring Taxonomy Terms as Sub Terms to Another Taxonomy in WordPress
First off, don’t do this (also, say that post title 10 times fast; r/titlegore). It’s better to not have to write logic into an app so that two things can see the same data from different parts of the db. It should be stored only in one spot and referenced from there. However, within a … Continued
Programmatically Flush WordPress Permalink Rewrite Rules
When adding rewrite rules with add_rewrite_rule add this to the file you are editing and avoid clicking save on the permalink settings page. // do not use on live/production servers add_action( 'init','maybe_rewrite_rules' ); function maybe_rewrite_rules() { $ver = filemtime( __FILE__ ); // Get the file time for this file as the version number $defaults = … Continued
WordPress Admin Taxonomy Sidebar Resize
I’m currently setting up an admin for a clients redesign. There’s going to be a hefty amount of categories and I wanted to make the selector in the sidebar resizable for at least a little bit easier viewing.
The simple if not completely cross browser friendly (chrome, ff, safari) way to do this is css’s resize
.
/* #talent-categoriesdiv is the .postbox the parent box */
.wp-admin #talent-categoriesdiv .inside{
/*set an initial height, otherwise it will expand to show all rows*/
height: 300px;
resize: vertical;
overflow: scroll;
}
.wp-admin #talent-categoriesdiv .categorydiv{
height: 100%
}
.wp-admin #talent-categoriesdiv .tabs-panel{
height: calc( 100% - 78px );
max-height: unset;
}
Current Project: Stone Roberts
I’m currently working on a site redesign/development for the painter Stone Roberts.
There isn’t anything to be seen as of yet, but there is a Github repo I’ll keep updated as I go along.
More info can be found on it’s project page.
Add Special Chars to WordPress TinyMCE Char Map
Had an issue where a clients blog post had one of these in the post and it wasn’t being displayed right. The real issue was changing the ‘post_content’ field of the wp_posts table to UTF-8 Unicode (utf8mb4) from cp1252 West European, but (!) along the way I tried this. Put this in a plugin or functions.php and … Continued
Add browser and device name to WordPress body class
<?php // Add Browser-Detection function mv_browser_body_class($classes) { global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone; if($is_lynx) $classes[] = 'lynx'; elseif($is_gecko) $classes[] = 'gecko'; elseif($is_opera) $classes[] = 'opera'; elseif($is_NS4) $classes[] = 'ns4'; elseif($is_safari) $classes[] = 'safari'; elseif($is_chrome) $classes[] = 'chrome'; elseif($is_IE) { $classes[] = 'ie'; if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $_SERVER['HTTP_USER_AGENT'], $browser_version)) $classes[] = 'ie'.$browser_version[1]; } else $classes[] = 'unknown'; if($is_iphone) $classes[] = 'iphone'; if ( stristr( $_SERVER['HTTP_USER_AGENT'],"mac") ) { $classes[] = 'osx'; } elseif ( stristr( $_SERVER['HTTP_USER_AGENT'],"linux") ) { $classes[] = 'linux'; } elseif ( stristr( $_SERVER['HTTP_USER_AGENT'],"windows") ) { $classes[] = 'windows'; } return $classes; } add_filter('body_class','mv_browser_body_class');
Reading Today
PHP Sessions Can Hurt Your WordPress Performance
“Many of the projects that we onboard come with crippling performance issues that make their WordPress sites slow, resource-hungry and incapacitated under load. Today we’ll look at another common problem that we often see – PHP Sessions.”
Do not ever use the guid element for creating links – ever – ever
I was recently (I always seem to start posts with that phrase) learning how to update a clients posts post_title, slug (aka post_name in the db) and guid when a post title was changed programatically. I was using get_sample_permalink() in combination with wp_update_post() to generate a permalink and update the post guid along with the … Continued
WordPress eXtended RSS (WXR) file import error: Sorry, there has been an error. Failed to write file to disk.

I was working on a clients Dreamhost VPS server and received an error: Sorry, there has been an error. Failed to write file to disk.. That’s not something I’ve come across before. Some googling didn’t turn up much but this InMotion hosting support page did mention a full /tmp dir. A look at the php … Continued
Force Post Author Comments to Moderation in WordPress
By default in WordPress when an author of a post comments on their own posting the comment is automatically approved. This makes sense when authors are associated with the site, have access to admin, etc. There are cases where content from the general public is used to create posts and while the user is logged … Continued
Allow html in Contact Form 7 error messages
Contact Form 7 has a filter where one can alter the messages being sent back to the browser called wpcf7_validation_error. A simple htmlspecialchars_decode altering the $message variable before returning will do the trick. This function will run on any error for any form you have in your site (any CF7 form that is). If you … Continued
Jetpack 404 not found: devicepx.js

While setting up this site I noticed some files not found errors in dev console. One was devicepx.js which was in the jetpack modules path. It’s used to optionally load retina/HiDPI versions of files. I believe it would be for gravatars and since this site doesn’t use gravatars I deemed it unnecessary. //remove unecessary queing … Continued
Allow for ‘Pending’ and ‘Draft’ posts to be set as post parent
I recently needed to use posts with a heirarchal structure (like pages have by default) and ran into an issue where posts still in the draft and pending stage could not be added as a parent. This would not do as I was publishing a set of posts where I wanted more than one to … Continued