Support

Account

Forum Replies Created

  • Hello,
    Yes, there’s probably the following reason to that..

    => You may have WordPress 4.7+ with an hosting where Imagemagick or Imagick AND ghostscript are installed. Else you will not have the new wordpress option that automatically create an image preview of your PDF stored as an attachement image. More info here:
    https://make.wordpress.org/core/2016/11/15/enhanced-pdf-support-4-7/

    If you don’t have this option automatically activated, there’s 2 possibilities to try:
    1) you might maybe find a plugin that add the option to set a featured image to your PDF attachment… then you’ll need to manually attach the image to your PDF each time you download one.

    2) Else, try the following plugin – as WP 4.7 feature – it also require Imagemagick and Ghostscript, but for an unknown reason it was working for me on a website where the default WP 4.7+ behaviour were not working:
    https://fr.wordpress.org/plugins/pdf-image-generator/

    I don’t have more time to investigate, but if someone has the reason why this plugin works where WP 4.7 doesn’t, i’m curious of the answer.

  • Hello,

    FYI, I had same issue and did this hook to make it:

    function acf_change_icon_on_files ( $icon, $mime, $attachment_id ){ // Display thumbnail instead of document.png
    		
    		if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/upload.php' ) === false && $mime === 'application/pdf' ){
    			$get_image = wp_get_attachment_image_src ( $attachment_id, 'thumbnail' );
    			if ( $get_image ) {
    				$icon = $get_image[0];
    			} 
    		}
    		return $icon;
    	}
    	
    	add_filter( 'wp_mime_type_icon', 'acf_change_icon_on_files', 10, 3 );
  • Hello,

    I had same issue and make this hook for it:

    	function acf_change_icon_on_files ( $icon, $mime, $attachment_id ){ // Display thumbnail instead of document.png
    		
    		if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/upload.php' ) === false && $mime === 'application/pdf' ){
    			$get_image = wp_get_attachment_image_src ( $attachment_id, 'thumbnail' );
    			if ( $get_image ) {
    				$icon = $get_image[0];
    			} 
    		}
    		return $icon;
    	}
    	
    	add_filter( 'wp_mime_type_icon', 'acf_change_icon_on_files', 10, 3 );
  • Hello James,
    Here’s how i allow post formats in function.php.
    As you probably know, it’s not needed to register “Standard” post format with
    add_theme_support( ‘post-formats’, … )
    As it’s the default post format. In the printscreen, you’ll see, I’ve added “Standard” post format anyway to try if the bug was not due to that, but it doesn’t change ACF behavior.

    I’m not sure to understund your second remark about “adding custom taxonomies to the post or post formats”.

    To clarify what I’ve currently:
    – I’ve default post with default taxonomy. I dont’ use a custom taxonomy.
    – I’m trying to add a ACF dropdown field to the posts edit form that allow editor to link another Post only if this related post has “Standard” post format registred. For that, i’m trying to filter the dropdown by “Standard” post format, but this option is not available. Currently in ACF parameters, to filter the dropdown by post format, there’s only “Link” and “Aside” post format. I’m wondering if this bug is not due to the fact that “Standard” post format can’t be registered by add_theme_support() and ACF takes registered Posts formats and “forgot” to add the standard one.

    Thank you very much for you precious help.
    Jonas

  • Hello!
    Thank you for your quick reply. Here’s 2 screenshots to show which post formats are available and not.
    As I understund, the page link field has a Taxonomy filter that allow to filter post by Post format. There’s 2 posts format available (the 2 I’ve allowed in theme support in function.php) but not the default one called “Standard”.
    Thank you for your help!

Viewing 5 posts - 1 through 5 (of 5 total)