WordPress uploads folder permissions problem

December 4, 2014 at 11:06 pm | web, Wordpress.

If you are self hosting a WordPress blog install at some point you have run into a problem with permission or know someone who has.

Mostly it surrounds the uploads folder for your media. The internet is filled with threads about the problem. Do yourself a favor and don’t do as some people suggest and set the folder permission to 777 to fix the problem.

The first problem might be that the apache user that WordPress uses to create folders does not have permission to create the new folders. Usually the user is part of the www-data group. But not always. If you have the correct permissions you can update the owner of your uploads folder and subdirectories. su to the root user or use sudo on the commands.

Set ownership of uploads folders except .svn folders.
find /path/to/uploads ! -iregex .*\.svn.* | xargs chown -v webmaster:www-data

Next lets update any folder permissions in the uploads folder. Minus folders you don’t want to change. In this case .svn folders.

find /path/to/uploads ! -iregex .*\.svn.* -type d | xargs chmod -v 775

Now lets correct any permission problems with files in the uploads folders. Same thing with folder you don’t want to change like .svn

find /path/to/uploads ! -iregex .*\.svn.* -type f | xargs chmod -v 664

iOS Simulator in your App dock

May 6, 2014 at 10:24 am | Apple, web.

Where exactly is the iOS Simulator when you need it? Do you really need to open Xcode every time in order to just open the simulator? Why can’t you find it in finder or in Spotlight?

Here is a quick time to make the iOS Simulator easier to access.

1. xcode_package_contentsFind Xcode in your Applications folder and right click on the icon. Choose “Show Package Contents” (Apps are nothing more than folders that hide the contents)

2. Find the iOS Simulator App Alias in Contents>Applications and drag this icon to your App bar on your desktop. (An alias of an Alias)


If you haven’t already notice, there is a handy way to debug pages in the iOS simulator that is installed with Xcode.

Once you open iOS Simulator you can then open Safari on your desktop and in the Develop > iPhone Simulator menu your can select the page you want to debug. Super handy!

Compass NilClass

March 5, 2014 at 1:54 pm | Programming, SASS, web.

Had some awesome fun with a compass sass –watch statement today. The problem that I ran into was related to image sprites.

A statement like this.
sass --watch --compass --sourcemap _css

Would get me this. And compass would quit on me.

NoMethodError: undefined method `parent' for nil:NilClass Use --trace for backtrace.

The problem, it turned out, was related to the name of the images that the sprite was building from. Compass does not like integers at the front of the images and will quit and not compile when it sees them.

Other people have seen this same error and it could be related to the image_dir name in the config file like here or here, but this is another problem that you might run into.

“You like integer named images in a compass sprite folder. Nil Class” – Russell from Fat Albert.

Bad svn no donut!

November 19, 2013 at 3:49 pm | Programming, web.

The following command line in subversion will get you the response “At Revision 1234”. What this should be doing is updating the file to a specific revision. But what it should really say is “There is no file, you crackhead.” since there is no file at that location in the file system. How exactly can nothing have a revision number?

svn up -r1234 /nodirectiry/nofile.html

Google utmz cookie values

September 24, 2013 at 9:40 am | blabbing.

When trying to get values from PPC campaigns into marketing automation or into form fields, it’s always helpful to know what fields inside the Google utmz cookie match to which fields. Here is a basic list of the variables in the cookie and how they match up.

utmcmd => Medium
utmccn => Campaign
utmctr => Keyword
utmcsr => Source

Importing content from a wordpress.com site

August 7, 2013 at 10:23 am | web, Wordpress.

Couple of quick points when it comes time to move your wordpress.com site over to a self hosted site. This can be especially painful for a large site with lots of users.

  • Export gives user name but no email and NO OTHER content. No password, no author status – You will have to edit this for all your users once your import the content
  • Export does not give users who do not have at least one post. – This can be a problem if you have people who don’t post but who edit other peoples posts.
  • Export WILL give users who are not on the users list but have made a post. – This can be confusing when you go to edit users.
  • The nice part is that the XML content that you export from wordpress.com has links to all the media you uploaded and will import that into you new site.

Using colorbox with multiple styles

July 29, 2013 at 10:36 pm | web.

If you happen to run into the need to use colobox with two different styles, like one for photos and one for videos you can use the className param in later versions of Colorbox or you can use jQuery to add “addClass” to the wrapper ID so you can target the individual styles that you need to make the version different.

One thing to remember is that adding the class will mean that Colorbox will still render the styles as if the original styles were still there, so if you don’t need certain border and drop shadow background images in your new CSS it is better to use “background: none;” rather than “display: none;” as colorbox has already rendered the cbox styles as if the styles were still there. (eg. Inline padding and styles to determine width.)

#cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px 0;}
.newstyle #cboxTopLeft{background: none;}

Google Maps pin bubble

at 10:17 pm | blabbing.

If you are looking to get rid of the Google Maps location bubble for simple Google maps iFrames try adding &iwloc=near to the end of the iFrame SRC url.

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=917+SW+Oak+St,+Portland,+OR&amp;aq=0&amp;oq=917+SW+Oak&amp;sll=45.543408,-122.654422&amp;sspn=0.588145,1.423416&amp;ie=UTF8&amp;hq=&amp;hnear=917+SW+Oak+St,+Portland,+Multnomah,+Oregon+97205&amp;t=m&amp;z=14&amp;ll=45.522687,-122.680434&amp;output=embed&amp;iwloc=near"></iframe>

Vimeo video fitvid

February 22, 2013 at 3:18 pm | blabbing.

Just testing to see if WordPress will automatically use the Vimeo iFrame embed by simply typing in the Vimeo URL.

Oh fitvid. You rock.

Adding Featured image to a post in WordPress

February 5, 2013 at 10:51 am | blabbing.

Quick Youtube movie I did about adding featured images to a post in WordPress.

Code that will add the featured image to your post

// check if the post has a Post Thumbnail assigned to it.
if ( has_post_thumbnail() ) {
    // This would tell WordPress that if there is a 
    // Featured image to insert it in the page	
// Regular Content from the Post

Post Thumbnail / Featured Image on WordPress Site