RandallFlagg
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Meta_Key to Featured Image problemNo help? =(
Forum: Fixing WordPress
In reply to: Meta_Key to Featured Image problemThis is the closest I got to a solution so far. In functions.php I create a new function.
function meta_to_featured_image($postID, $image){ $filename = $image; $wp_filetype = wp_check_filetype(basename($filename), null ); $wp_upload_dir = wp_upload_dir(); $attachment = array( //'guid' => $wp_upload_dir['baseurl'] . _wp_relative_upload_path( $filename ), 'guid' => $filename, 'post_mime_type' => $wp_filetype['type'], 'post_title' => preg_replace('/\.[^.]+$/', '', basename($filename)), 'post_content' => '', 'post_status' => 'inherit' ); $attach_id = wp_insert_attachment( $attachment, $filename, $postID ); // you must first include the image.php file // for the function wp_generate_attachment_metadata() to work require_once(ABSPATH . 'wp-admin/includes/image.php'); $attach_data = wp_generate_attachment_metadata( $attach_id, $filename ); wp_update_attachment_metadata( $attach_id, $attach_data ); }
Since I’m getting the file path from an actual URL, I pass that to the GUID.
Problem is that is does not work properly. I extract the image, but It can’t regenerate the thumbnails with the plugin Regenerate Thumbnails, since it finds a problem with the path in the server.Since I have 380 post, I do this also in the index
query_posts(array('showposts' => 380 )); if ( have_posts() ) : while ( have_posts() ) : the_post(); $imagen = get_post_meta($post->ID, 'post_image'); echo $post->ID.'- '.$imagen[0].'<br>'; meta_to_featured_image($post->ID, $imagen[0]); endwhile; endif;
So I call all my posts.
But still wont work for me. It generate an image per post, but wont work for Auto Featured Image or Auto Post Thumbnail to create a Featured Image.Forum: Fixing WordPress
In reply to: Meta_Key to Featured Image problemOkay, got this part now, (but still don’t know how to do it)
Every post create a _thumbnail_id. This thumbnail_id have the meta_value with the ID that contains the image information.
What I dont know is how to create in the database the new _thumbnail_id and relate them to each other…Forum: Fixing WordPress
In reply to: How to show authors by level of users and number of posts?The idea is to show all the writers, editor etc as part of the staff, so It won’t be inside the loop!
Forum: Fixing WordPress
In reply to: Need Author List Ordering by NameCan you share?
Forum: Fixing WordPress
In reply to: Upload Media – Unable to Create DirectoryGo to your web directory via shell and look there to whom does that directory belong!
Then make a chown to change that to your user!
(recently I had that problem, and the only way I could change the directory permissions where via Shell)Forum: Plugins
In reply to: [Plugin: BuddyPress Groupblog] blog roles appending issueI have another problem with this puglin.
When I try to change the role of and user, this don’t change, or worst, it kick me back to suscriber, even if I’m a author by default role.Really annoying bug… :S
Forum: Fixing WordPress
In reply to: Hole Security -help!thanks.. I’ll do some things that are there =)
Forum: Themes and Templates
In reply to: IE6 hover problemsI have a problem Kinda like that.
I’m using hover images to do a menu, and ok, IE7, FF & Opera work just fine.
For any problem with IE6 I use the Hacks of Behavior with .htc files…but, when doing the hover in the menu which has 6 options, only 2 work fine, an the rest stay still like there is no hover…
I use de CSSHOVER.HTC, and have a css exlcusive for all the troubles with IE (which btw it’s called iefix.css)
have you try the htc hack for ie?