Jan-Willem
Forum Replies Created
-
Hi Nadya,
The DFi plugin does nothing with Javascript on the frontend. It only changes the HTML of the featured image,
It does include Javascript in the wp-admin. Do you do minification in the admin?
Best,
Jan-WillemForum: Plugins
In reply to: [Default Featured Image] Critical error when using custom post type imageDoes the regular Default Featured Image work?
The one that you can set in the settings.Forum: Plugins
In reply to: [Default Featured Image] Critical error when using custom post type imageAre you sure 8924 is an image ID?
if not images are showing it is different, so it does something.Does the regular DFI show when you remove this snippet?
Forum: Plugins
In reply to: [Default Featured Image] Critical error when using custom post type imageHi,
The code has the wrong quotes types. I don’t know if this is because an copy-paste error.
But below is the correctly formatted code:add_filter( 'dfi_thumbnail_id', 'dfi_posttype_listings', 10, 2 );
function dfi_posttype_listings( $dfi_id, $post_id ) {
$post = get_post( $post_id );
if ( 'listings' === $post->post_type ) {
return 8924;
}
return $dfi_id;
}And side from wrong quotes this seems like the correct code.
Let me know how it goes.
Jan-WillemForum: Plugins
In reply to: [WooCommerce] /?wc-ajax=update_order_review 403We are using CloudFlare. And under some certain conditions it also blocked these requests under it’s “Cloudflare OWASP Core Ruleset”.
Maybe this information will save somebody else an hour in the future.
Forum: Plugins
In reply to: [Default Featured Image] Removing default featured image not workingHi,
What access do you have?
Can you install plugins?
Without access to code this will be quite impossible to test.Forum: Reviews
In reply to: [Default Featured Image] Ottimo! Aggiornamento!CIAO,
Mantengo questo plugin da più di 10 anni e continuerò a farlo nel prossimo futuro. È uno sforzo molto basso da mantenere.
*translated with google translate.
Forum: Plugins
In reply to: [Default Featured Image] Restrict Default Image to One Post TypeHi Dave.
Always good to hear someone tweaking it by themselves.
This is exactly how I would code this.
Best, Jan-Willem
Forum: Plugins
In reply to: [Default Featured Image] WPML compatibilityHi,
It took a bit longer then expected. Mostly because i thought WPML had a free version, so I needed to find somebody to help me out.
But I’m pretty sure I found the correct fix.Can you remove the DFI plugin, download this zip, and install this new beta version.
And test of course, my tests worked.Please let me know so I can release this to everybody.
Jan-Willem
Forum: Plugins
In reply to: [Default Featured Image] Multiple images for different categoriesYes sorry there is a syntax error, that’s what you get when doing it in a hurry..
The code below has the missing;
add_filter( 'dfi_thumbnail_id', 'dfi_category_random', 10, 2 ); function dfi_category_random( $dfi_id, $post_id ) { // Set a different image for posts that have the 'cats' category set. if ( has_category( 'cats', $post_id ) ) { $random_cats = array( 7, 8, ); return $random_cats[ array_rand( $random_cats ) ]; } // Set a different image for posts that have the 'dogs' category set. if ( has_category( 'dogs', $post_id ) ) { $random_dogs = array( 10, 14, ); return $random_dogs[ array_rand( $random_dogs ) ]; } return $dfi_id; // the original featured image id. }
Forum: Plugins
In reply to: [Default Featured Image] Multiple images for different categoriesHi jess,
The following code should help. It allows you to set different images per category.
add_filter( 'dfi_thumbnail_id', 'dfi_category_random', 10, 2 ); function dfi_category_random( $dfi_id, $post_id ) { // Set a different image for posts that have the 'cats' category set. if ( has_category( 'cats', $post_id ) ) { $random_cats = array( 7, 8, ); return $random_cats[ array_rand( $random_cats ) ] } // Set a different image for posts that have the 'dogs' category set. if ( has_category( 'dogs', $post_id ) ) { $random_dogs = array( 10, 14, ); return $random_dogs[ array_rand( $random_dogs ) ] } return $dfi_id; // the original featured image id. }
Let me know how it goes.
Jan-Willem
Forum: Plugins
In reply to: [Default Featured Image] Multiple images for different categoriesHi Jess,
Yes, its possible. there is a example in the FAQ. You can put the code in the theme’s
functions.php
or in a new/separate plugin.I’m not near a computer to provide a full example. If you need more help let me know and I’ll help tomorrow.
Jan-Willem
Forum: Reviews
In reply to: [Default Featured Image] muy contentaThank you for the review, I appriciate it 🙂
Forum: Plugins
In reply to: [Default Featured Image] custom image based on “event category”Hello Vic,
That certainly is possible, we just need to to use a different taxonomy function (custom categories are called taxonomies).
I’m not familiar with Event Calendar, so I don’t know how that taxonomy is called, But if there is a edit page in the admin you should be able to find it in the url: example:
example.com/wp/wp-admin/edit-tags.php?taxonomy=EVENT_CALENDAR_TAX
Given that, the following snippet should work:
add_filter( 'dfi_thumbnail_id', 'dfi_event_calendar', 10, 2 ); function dfi_event_calendar( $dfi_id, $post_id ) { // This will trigger first, if multiple categories have been set. if ( has_term( 'cats', 'REPLACE_WITH_TAXONOMY_NAME', $post_id ) ) { return 7; // cats img id. } if ( has_term( 'dogs', 'REPLACE_WITH_TAXONOMY_NAME', $post_id ) ) { return 8; // dogs img id. } return $dfi_id; // the original featured image id. }
Let me know how it goes.
Forum: Plugins
In reply to: [Default Featured Image] WPML compatibilityHi,
Currently I’m very full and don’t have.
I’ll take a look in februari.