Forum Replies Created

Viewing 9 replies - 16 through 24 (of 24 total)
  • Thread Starter RandallFlagg

    (@randallflagg)

    No help? =(

    Thread Starter RandallFlagg

    (@randallflagg)

    This 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.

    Thread Starter RandallFlagg

    (@randallflagg)

    Okay, 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…

    Thread Starter RandallFlagg

    (@randallflagg)

    The idea is to show all the writers, editor etc as part of the staff, so It won’t be inside the loop!

    Can you share?

    Go 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)

    I 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

    Thread Starter RandallFlagg

    (@randallflagg)

    thanks.. I’ll do some things that are there =)

    I 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?

Viewing 9 replies - 16 through 24 (of 24 total)