Plugin Creation: Overriding upload_max_size and post_max_size

First, the setting you want is ‘upload_max_filesize’, not ‘upload_max_size’. Second, both of those settings are PHP_INI_PERDIR, which means they can only be set with php.ini, .htaccess, or httpd.conf. For more information see the PHP documentation on php.ini directives and their configuration. I would suggest using .htaccess, personally. You might look into writing the information directly … Read more

How can the_excerpt (or equivalent) be called on a category description?

wp_html_excerpt($category->description, 25). Or you can create your own function. I’m using this: /** * Filters content based on specific parameters, and appends a “read more” link if needed. * Based on the “Advanced Excerpt” plugin by Bas van Doren – http://sparepencil.com/code/advanced-excerpt/ * * @since 1.0 * * @param string $content What to filter, defaults to … Read more

WP 3-way voting system: On to something! Please help!

Here’s a simple solution. Append the ratings to the end of the post content: add_filter(‘the_content’, ‘add_ratings_to_content’, 4); // remove ratings from excerpts add_filter(‘get_the_excerpt’, create_function(”, ‘remove_filter(“the_content”, “add_ratings_to_content”, 6); return;’), 5); function add_ratings_to_content($content){ global $post; if(is_single()) $content .= the_ratings($post->ID); return $content; } Displays the current rating: function get_current_rating($post_id){ $votes = get_option(“votes_{$post_id}”); // handle your rating format here … Read more