• Resolved pr0fess0r

    (@pr0fess0r)


    Hi

    As part of the CSV, I want to export the Featured Image for a post, but the only options I have in WP All Export are Images / Media (which seems to export a pipe-delimited list of all Images in the post in that field) or Attachments, which doesnt export anything. How do I Just export the featured image URL as one of the CSV columns?

    https://www.ads-software.com/plugins/wp-all-export/

Viewing 1 replies (of 1 total)
  • Plugin Author WP All Import

    (@wpallimport)

    We agree, it should be easier to export just the Featured Image URL and we’re going to make image exports a lot better in the coming months.

    As of right now, you can export the Featured Image URL by using a function that takes the post ID and returns the URL of the featured image. Here’s the function you can add to your functions.php file:

    function featured_image_lookup( $post_id ) {
    
    	$image_id = get_post_thumbnail_id( $post_id );
    
    	if ( !empty( $image_id ) ) { 
    
    		$image_attributes = wp_get_attachment_image_src( $image_id, 'full' );
    
    		$image_url = $image_attributes[0];
    
    		return $image_url;
    	}
    }

    And in WP All Export after you drag over the ID element and click it to open the options box, here’s how you’d call the function: https://i.imgur.com/vVEc4JL.jpg

Viewing 1 replies (of 1 total)
  • The topic ‘Export Featured Image, not all images’ is closed to new replies.