• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

wordpress

Media Uploader Crunching Issue

April 10, 2012 by Webhead

Problem

WordPress has a bug.  When uploading an image (even a small,  1KB image) the Media uploader stalls and freezes in when Crunching is 100%.   This problem happens in both the flash and html uploader.  In the HTML uploader you can see a 500 Internal Server Error.

 

Solution

There are 2 different problems that can cause this issue.

One is your server or hosting provider.  GoDaddy has since said they have fixed this issue.  However, when I contacted support they said to disable Fast CGI for PHP.  I responded with a link to the article above.  They then helped me out by telling me to update my php5.ini or php.ini file.   You’ll find that this solution was found on the WordPress forums also where you set the memory_limit and max_execution_time higher.  So in your php.ini or php5.ini if you use php5 (that’s important!  trust me, I’ve been frustrated with that before) add the following lines:
max_execution_time = 600
memory_limit =128M
upload_max_filesize = 2M

Adjust as needed.  You may also have to End your Web Process to quickly see changes.  See godaddy support forums for this.

The 2nd issue with this bug is a more frustrating and disappointing one.  I found out that WordPress uses the delete_posts capability to determine whether a user can delete a media file or not.  Well, guess what, it also uses the edit_posts capability when it crunches the file too.  So if you have a problem where only the Administrator can upload media files fine, check your user’s capabilities.  On a side note, to delete media the user needs the delete_posts capability.

 

 

 

Filed Under: Coding Tagged With: goDaddy, hosting, php, wordpress

WordPress Deactive Plugin

April 5, 2012 by Webhead

Problem

I had a wordpress site where the public side was fine, but the admin side was throwing a Internal Server Error 500 intermittently.   I couldn’t figure out what was wrong since I had done no changes, and my host said nothing was wrong with the server.  To solve mysterious crashing errors in WordPress, the standard procedure is to first deactivate all your plugins.  However, I could not log in, so how was I to deactivate them?

Solution

A very smart fellow on the wordpress.org forums suggested to log into phpMyAdmin, and look at the wp_options table.  Then look for ‘active_plugins’ string under the option_name field.  Once located, change the option value to  a:0:{}

This deactivates all plugins.  Once deactivated, I re-activated each plugin and found the culprit.  It turned out the plugin was contacting its creator’s server and the creator’s server was down at the time.

source: http://wordpress.org/support/topic/500-internal-server-error-wp-admin-only

Filed Under: Coding Tagged With: debug, mysql, wordpress

WordPress Custom Types

March 22, 2012 by Webhead

Below is a great example on creating custom post types and also not using the edit_posts capability.

Blog: http://www.jsterup.com/dev/wordpress/custom-post_type-without-edit_post-capability

Code: http://pastebin.com/FfftYVYS

Filed Under: Coding Tagged With: php, wordpress

WordPress Next Gen Gallery Skinny Thumbnails in IE8

March 7, 2012 by Webhead

Problem

The thumbnails for the next-gen gallery wordpress plugin show up very skinny.  However using the nggallery widget with IE8 Webslices seems to work fine.  I tried adding “webslice=1” or some variation of it to include this webslice option for IE8, however, I don’t think it was implemented.

Solution

A great solution that solved my problem was found on the link below.  You just need to add the following to your style.css:

.ngg-gallery-thumbnail {width:160px;padding-right:10px;}

source: http://nuuvidea.com/fix-for-nextgen-gallery-internet-explorer/

keywords: nextgen gallery ie8

Filed Under: Coding Tagged With: IE crap, wordpress

WordPress Post Status Transition

March 7, 2012 by Webhead

WordPress has actions for every transition of a post or page.  From new_to_publish to trash_to_draft… pretty useful and sometimes hard to remember or find:

http://codex.wordpress.org/Post_Status_Transitions

 

Filed Under: Coding Tagged With: wordpress

wp_nav_menu adding a class to a menu item

March 6, 2012 by Webhead

Problem

I have a menu which uses wp_nav_menu and I need to add a class to the first item because my menu items have a left border on them.  I don’t want the first item to show a border.

 

Solution

WordPress is just so easy to use.  This may not have been in previous versions, but as of 3.3.1 at least there is a way to add a class to each menu item through the interface.  Go to Appearnace->Menus.  At the top, click on Screen Options and check “CSS Classes”.  Now you can expand a menu item and add a class in there.

 

Thanks to: http://www.sandboxdev.com/2010/09/23/howto-add-custom-classes-to-individual-items-wp_nav_menu/

Filed Under: Coding Tagged With: wordpress

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 8
  • Go to page 9
  • Go to page 10
  • Go to page 11
  • Go to page 12
  • Go to Next Page »

Primary Sidebar

Topics

apache apple bootstrap buddypress chrome cloudways cms css debug drupal eCommerce firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery kinsta linux localization mac os x ms sql mysql open source optimize php php 7.2 svg tinymce woocommerce wordpress wpengine xss yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools
  • Uncategorized