-
Popular Posts
-
Search
-
Recent Posts
Follow for New Updates
Tags
analytics api apple blog browser chrome chromium Design dropbox email error extension facebook firefox google greasemonkey ipad javascript jQuery keyboard linux lion mac Marketing mysql os x osx php plugin project quicksilver scam search SEO social spam ssl themes twitter unix ux video windows woo wordpress
Tag Archives: wordpress
WooThemes Graphic Designer
The WooThemes Graphic Designer team consistently does a nice job of getting their message across. They obviously have a strong background in visual communication. Take for example their simple message promoting a new product:
Posted in Design, Web Development
Tagged Design, graphic design, themes, woo, woo themes, wordpress
Leave a comment
Understanding WordPress’ add_image_size (with examples)
WordPress’s add_image_size function can be a little tricky to master, especially understanding how the cropping and resizing works. I’ve dedicated a blog entry to explaining how the images are cropped on an image that is larger than the maximum size, and below are the results. The WordPress documentation for the add_image_size() function has the following components: Usage < ?php add_image_size( $name, $width, $height, $crop ); ?> Parameters $name (string) (required) The new image size name. Default: None $width (int) (optional) The post thumbnail width in pixels. Default: 0 $height (int) (optional) The post thumbnail height in pixels. Default: 0 $crop (boolean) (optional) Crop the image or not. False – Soft proportional crop mode ; True – Hard crop mode. Default: false Original Image (404w x 1587h) Next, the original image, which is 404w by 1587h. Soft Crop, Very Tall Height This results in a proportional image that is 185w by 726h. In this case the image is limited by it’s width, 185px. add_image_size( ‘feature’, 185, 1200, false ); Soft Crop, Normal Height This results in a proportional image that is 54w by 215h. The image is limited by the height. add_image_size( ‘feature1′, 185, 215, false ); Hard Crop, Very Tall Height This results in a disproportionate image which is exactly 185 x 1200, but the edges of the image are lost. This works semi-ok here but would not be good if we were uploading a logo, something with text, or a person with important features on the edges of the … Continue reading
Posted in Tech Tips, Web Development
Tagged add_image_size, crop, proportions, resize, wordpress
Leave a comment
Fix “Post Types Order” plugin error with HTTPS
The WordPress Plugin Post Types Order by NSP CODE is helpful in as it allows you to Order Posts and Post Types Objects using a Drag and Drop Sortable javascript capability But unfortunately the plugin does not work with wordpress HTTPS / SSL admin – or at least not without errors: But the good news is that there is an easy fix with changing just a few lines of code: At the top of the post-types-order.php page there are two constant definitions: define(‘CPTPATH’, ABSPATH.’wp-content/plugins/post-types-order’); define(‘CPTURL’, get_option(‘siteurl’).’/wp-content/plugins/post-types-order’); And the second one needs to use the plugins_url() function that WordPress recommends instead: define(‘CPTPATH’, ABSPATH.’wp-content/plugins/post-types-order’); define(‘CPTURL’, plugins_url().’/post-types-order’); After that you should stop receiving the HTTPS error for some insecure content when you are in the WP administration interface.
Posted in Tech Tips, Web Development
Tagged https, php, plugin, secure, ssl, wordpress
Leave a comment
WordPress: Change Insert Link (list) to use short permalinks with post ID
in wp-includes/class-wp-editor.php, change the line that has the permalink from ‘permalink’ => get_permalink( $post->ID ), to ‘permalink’ => ‘/?p=’.$post->ID, That was line 749 in version 3.3 beta 1 function wp_link_query( $args = array() ) { $pts = get_post_types( array( ‘public’ => true ), ‘objects’ ); $pt_names = array_keys( $pts ); $query = array( ‘post_type’ => $pt_names, ‘suppress_filters’ => true, ‘update_post_term_cache’ => false, ‘update_post_meta_cache’ => false, ‘post_status’ => ‘publish’, ‘order’ => ‘DESC’, ‘orderby’ => ‘post_date’, ‘posts_per_page’ => 20, ); $args['pagenum'] = isset( $args['pagenum'] ) ? absint( $args['pagenum'] ) : 1; if ( isset( $args['s'] ) ) $query['s'] = $args['s']; $query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] – 1 ) : 0; // Do main query. $get_posts = new WP_Query; $posts = $get_posts->query( $query ); // Check if any posts were found. if ( ! $get_posts->post_count ) return false; // Build results. $results = array(); foreach ( $posts as $post ) { if ( ‘post’ == $post->post_type ) $info = mysql2date( __( ‘Y/m/d’ ), $post->post_date ); else $info = $pts[ $post->post_type ]->labels->singular_name; $results[] = array( ‘ID’ => $post->ID, ‘title’ => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ), ‘permalink’ => ‘/?p=’.$post->ID, ‘info’ => $info, ); } return $results; }
Breadcrumb NavXT: Remove category
If you’re using the breadcrumb navxt plugin and trying to remove categories from showing up, such as Home -> Blog -> Uncategorized -> Post Title (a common request), you have to do a bit of trickery to accomplish this. You can either add a class to the category breadcrumb and style it accordingly in CSS, or you can just hide it all together. To add a CSS class, you will go to the Breadcrumbs Nav XT options page and add a class: If you want to hide it all together, add style=”display:none;” instead:
Posted in Tech Opinion, Web Development
Tagged breadcrumbs, breadcrumbs navxt, category, wordpress
Leave a comment
Multiple Post Thumbnails Plugin Broken (and Fixed)
The Multiple Post Thumbnails plugin is not working for me using WP 3.2.1. Apparently the function can not determine the ID of the related post with the current setup, that happens around line 190, “public static function get_the_post_thumbnail” My proposed solution is to change this: global $id; $post_id = (NULL === $post_id) ? $id : $post_id; to this: global $id; global $post; $post_id = (NULL === $post_id) ? $id : $post_id; if(!$post_id){ if(!empty($post->ID)){ $post_id = $post->ID; } } It’s not 100% clean but it’s fairly easy to read and it work for me.
How To Reset Permissions after using WordPress “Members” plugin
You may have noticed while using the WordPress Members plugin a certain disclaimer: Any changes you make to users and roles using this feature are permanent changes. What I mean by this is that if you deactivate or uninstall this plugin, the changes won’t revert to their previous state. This plugin merely provides a user interface for you to make changes directly to your WordPress database. Please use this feature wisely. There is in fact a fairly comprehensive guide that comes with the plugin, but it does not talk about how to revert changes. Well, after a little digging I’ve realized that the plugin mainly edits a database entry called “wp_user_roles.” I did a fresh install of WordPress 3.1RC2 and grabbed the value of that database entry, which is serialized. The result was this: a:5:{s:13:”administrator”;a:2:{s:4:”name”;s:13:”Administrator”;s:12:”capabilities”;a:62:{s:13:”switch_themes”;b:1;s:11:”edit_themes”;b:1;s:16:”activate_plugins”;b:1;s:12:”edit_plugins”;b:1;s:10:”edit_users”;b:1;s:10:”edit_files”;b:1;s:14:”manage_options”;b:1;s:17:”moderate_comments”;b:1;s:17:”manage_categories”;b:1;s:12:”manage_links”;b:1;s:12:”upload_files”;b:1;s:6:”import”;b:1;s:15:”unfiltered_html”;b:1;s:10:”edit_posts”;b:1;s:17:”edit_others_posts”;b:1;s:20:”edit_published_posts”;b:1;s:13:”publish_posts”;b:1;s:10:”edit_pages”;b:1;s:4:”read”;b:1;s:8:”level_10″;b:1;s:7:”level_9″;b:1;s:7:”level_8″;b:1;s:7:”level_7″;b:1;s:7:”level_6″;b:1;s:7:”level_5″;b:1;s:7:”level_4″;b:1;s:7:”level_3″;b:1;s:7:”level_2″;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:17:”edit_others_pages”;b:1;s:20:”edit_published_pages”;b:1;s:13:”publish_pages”;b:1;s:12:”delete_pages”;b:1;s:19:”delete_others_pages”;b:1;s:22:”delete_published_pages”;b:1;s:12:”delete_posts”;b:1;s:19:”delete_others_posts”;b:1;s:22:”delete_published_posts”;b:1;s:20:”delete_private_posts”;b:1;s:18:”edit_private_posts”;b:1;s:18:”read_private_posts”;b:1;s:20:”delete_private_pages”;b:1;s:18:”edit_private_pages”;b:1;s:18:”read_private_pages”;b:1;s:12:”delete_users”;b:1;s:12:”create_users”;b:1;s:17:”unfiltered_upload”;b:1;s:14:”edit_dashboard”;b:1;s:14:”update_plugins”;b:1;s:14:”delete_plugins”;b:1;s:15:”install_plugins”;b:1;s:13:”update_themes”;b:1;s:14:”install_themes”;b:1;s:11:”update_core”;b:1;s:10:”list_users”;b:1;s:12:”remove_users”;b:1;s:9:”add_users”;b:1;s:13:”promote_users”;b:1;s:18:”edit_theme_options”;b:1;s:13:”delete_themes”;b:1;s:6:”export”;b:1;}}s:6:”editor”;a:2:{s:4:”name”;s:6:”Editor”;s:12:”capabilities”;a:34:{s:17:”moderate_comments”;b:1;s:17:”manage_categories”;b:1;s:12:”manage_links”;b:1;s:12:”upload_files”;b:1;s:15:”unfiltered_html”;b:1;s:10:”edit_posts”;b:1;s:17:”edit_others_posts”;b:1;s:20:”edit_published_posts”;b:1;s:13:”publish_posts”;b:1;s:10:”edit_pages”;b:1;s:4:”read”;b:1;s:7:”level_7″;b:1;s:7:”level_6″;b:1;s:7:”level_5″;b:1;s:7:”level_4″;b:1;s:7:”level_3″;b:1;s:7:”level_2″;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:17:”edit_others_pages”;b:1;s:20:”edit_published_pages”;b:1;s:13:”publish_pages”;b:1;s:12:”delete_pages”;b:1;s:19:”delete_others_pages”;b:1;s:22:”delete_published_pages”;b:1;s:12:”delete_posts”;b:1;s:19:”delete_others_posts”;b:1;s:22:”delete_published_posts”;b:1;s:20:”delete_private_posts”;b:1;s:18:”edit_private_posts”;b:1;s:18:”read_private_posts”;b:1;s:20:”delete_private_pages”;b:1;s:18:”edit_private_pages”;b:1;s:18:”read_private_pages”;b:1;}}s:6:”author”;a:2:{s:4:”name”;s:6:”Author”;s:12:”capabilities”;a:10:{s:12:”upload_files”;b:1;s:10:”edit_posts”;b:1;s:20:”edit_published_posts”;b:1;s:13:”publish_posts”;b:1;s:4:”read”;b:1;s:7:”level_2″;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:12:”delete_posts”;b:1;s:22:”delete_published_posts”;b:1;}}s:11:”contributor”;a:2:{s:4:”name”;s:11:”Contributor”;s:12:”capabilities”;a:5:{s:10:”edit_posts”;b:1;s:4:”read”;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:12:”delete_posts”;b:1;}}s:10:”subscriber”;a:2:{s:4:”name”;s:10:”Subscriber”;s:12:”capabilities”;a:2:{s:4:”read”;b:1;s:7:”level_0″;b:1;}}} Or via a textarea element: a:5:{s:13:”administrator”;a:2:{s:4:”name”;s:13:”Administrator”;s:12:”capabilities”;a:62:{s:13:”switch_themes”;b:1;s:11:”edit_themes”;b:1;s:16:”activate_plugins”;b:1;s:12:”edit_plugins”;b:1;s:10:”edit_users”;b:1;s:10:”edit_files”;b:1;s:14:”manage_options”;b:1;s:17:”moderate_comments”;b:1;s:17:”manage_categories”;b:1;s:12:”manage_links”;b:1;s:12:”upload_files”;b:1;s:6:”import”;b:1;s:15:”unfiltered_html”;b:1;s:10:”edit_posts”;b:1;s:17:”edit_others_posts”;b:1;s:20:”edit_published_posts”;b:1;s:13:”publish_posts”;b:1;s:10:”edit_pages”;b:1;s:4:”read”;b:1;s:8:”level_10″;b:1;s:7:”level_9″;b:1;s:7:”level_8″;b:1;s:7:”level_7″;b:1;s:7:”level_6″;b:1;s:7:”level_5″;b:1;s:7:”level_4″;b:1;s:7:”level_3″;b:1;s:7:”level_2″;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:17:”edit_others_pages”;b:1;s:20:”edit_published_pages”;b:1;s:13:”publish_pages”;b:1;s:12:”delete_pages”;b:1;s:19:”delete_others_pages”;b:1;s:22:”delete_published_pages”;b:1;s:12:”delete_posts”;b:1;s:19:”delete_others_posts”;b:1;s:22:”delete_published_posts”;b:1;s:20:”delete_private_posts”;b:1;s:18:”edit_private_posts”;b:1;s:18:”read_private_posts”;b:1;s:20:”delete_private_pages”;b:1;s:18:”edit_private_pages”;b:1;s:18:”read_private_pages”;b:1;s:12:”delete_users”;b:1;s:12:”create_users”;b:1;s:17:”unfiltered_upload”;b:1;s:14:”edit_dashboard”;b:1;s:14:”update_plugins”;b:1;s:14:”delete_plugins”;b:1;s:15:”install_plugins”;b:1;s:13:”update_themes”;b:1;s:14:”install_themes”;b:1;s:11:”update_core”;b:1;s:10:”list_users”;b:1;s:12:”remove_users”;b:1;s:9:”add_users”;b:1;s:13:”promote_users”;b:1;s:18:”edit_theme_options”;b:1;s:13:”delete_themes”;b:1;s:6:”export”;b:1;}}s:6:”editor”;a:2:{s:4:”name”;s:6:”Editor”;s:12:”capabilities”;a:34:{s:17:”moderate_comments”;b:1;s:17:”manage_categories”;b:1;s:12:”manage_links”;b:1;s:12:”upload_files”;b:1;s:15:”unfiltered_html”;b:1;s:10:”edit_posts”;b:1;s:17:”edit_others_posts”;b:1;s:20:”edit_published_posts”;b:1;s:13:”publish_posts”;b:1;s:10:”edit_pages”;b:1;s:4:”read”;b:1;s:7:”level_7″;b:1;s:7:”level_6″;b:1;s:7:”level_5″;b:1;s:7:”level_4″;b:1;s:7:”level_3″;b:1;s:7:”level_2″;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:17:”edit_others_pages”;b:1;s:20:”edit_published_pages”;b:1;s:13:”publish_pages”;b:1;s:12:”delete_pages”;b:1;s:19:”delete_others_pages”;b:1;s:22:”delete_published_pages”;b:1;s:12:”delete_posts”;b:1;s:19:”delete_others_posts”;b:1;s:22:”delete_published_posts”;b:1;s:20:”delete_private_posts”;b:1;s:18:”edit_private_posts”;b:1;s:18:”read_private_posts”;b:1;s:20:”delete_private_pages”;b:1;s:18:”edit_private_pages”;b:1;s:18:”read_private_pages”;b:1;}}s:6:”author”;a:2:{s:4:”name”;s:6:”Author”;s:12:”capabilities”;a:10:{s:12:”upload_files”;b:1;s:10:”edit_posts”;b:1;s:20:”edit_published_posts”;b:1;s:13:”publish_posts”;b:1;s:4:”read”;b:1;s:7:”level_2″;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:12:”delete_posts”;b:1;s:22:”delete_published_posts”;b:1;}}s:11:”contributor”;a:2:{s:4:”name”;s:11:”Contributor”;s:12:”capabilities”;a:5:{s:10:”edit_posts”;b:1;s:4:”read”;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:12:”delete_posts”;b:1;}}s:10:”subscriber”;a:2:{s:4:”name”;s:10:”Subscriber”;s:12:”capabilities”;a:2:{s:4:”read”;b:1;s:7:”level_0″;b:1;}}} You can deactivate the plugin, backup your database, and tren try changing the wp_user_roles value of the wp_options table back to said value.
Accutane WordPress Hack
If your wordpress site is showing “Buy Accutane Online” in the Google Results, it’s because one of the plugins you’re using is not safe. One plugin know for this exploit is the “My Page Order” plugin by geekyweekly. I’d suggest removing the plugin all together. You’ll notice that the source code is clean, if you view it, as the plugin only affects the page when the Google bot is viewing it. The function is using two strings of binary character values: $unique_id = “\x62\x61s\x65\x36\x34\x5f\x64\x65c\x6f\x64\x65″ $unique_hash = “\x63\x72e\x61\x74\x65\x5f\x66\x75\x6ec\x74\x69\x6f\x6e” Those translate into base64_decode and create_function respectively, which are two functions you don’t want to see in any plugin or theme, they are usually responsible for maladies. You should also check your server logs for “wxdGrgPB” as that is the post/get variable used to send malicious commands to this script.

