Big Image on Featured Post, Normal on Single Post

You can show featured images at multiple sizes easily enough, by specifying the size of image when you make the call, but if you want them to be different you can use the code in this plugin: http://wordpress.org/extend/plugins/multiple-featured-images/ Here’s a tutorial: http://lifeonlars.com/wordpress/how-to-add-multiple-featured-images-in-wordpress/ e.g. Example registration: if (class_exists(‘MultiPostThumbnails’) { if (MultiPostThumbnails::has_post_thumbnail(‘folio’, ‘feature-image-2’)) { MultiPostThumbnails::the_post_thumbnail(‘folio’, ‘feature-image-2’); } … Read more

WordPress choose wrong database

In case someone is interested. I made it work. I made a plugin and in the main php-file I wrote this. <?php function ir_load(){ include_once(ABSPATH . ‘load.php’); } function db_fix_login(){ global $wpdb; $wpdb->select(DB_NAME); } add_action(“wp_head”,”db_fix_login”, 0); ir_load(); db_fix_login(); ?> The ir_load() contains the database connection to my database. I made it a function in case … Read more

Strange behaviour with add_{$meta_type}_metadata | add_post_metadata filter

Ok I’ve found the solution… I have had to call add_filter outside my plugin class, because of WordPress hooks priority. With the actual code, I call add_filter after the ‘init’ event, that’s probably too late. If I move this line of code: add_filter(‘add_post_metadata’,array(&$this,’filter_negozi_add_metadata’),10,5); on top of the file, the hook works like expected. So to … Read more

How to split text text text into array

Firstly, you need to remove the paragraph tags that were added by the wp_autop filter. There’s another answer that covers this pretty well: Is there an uw-wp_autop function? I’m going to change the function a little for our purposes (based on the markup example you gave): function reverse_wpautop( $s ) { // Strip newlines $s … Read more