Forum Replies Created

Viewing 15 replies - 16 through 30 (of 455 total)
  • Plugin Author Jan-Willem

    (@janwoostendorp)

    Hi 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

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Thank you for the review, I appriciate it 🙂

    Plugin Author Jan-Willem

    (@janwoostendorp)

    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.

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hi,

    Currently I’m very full and don’t have.
    I’ll take a look in februari.

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hi,

    Did my suggestions help?
    Let me know, otherwise I’m closing this ticket.

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hi,

    This is a bit terrifying to hear.
    But probably not that hard to fix.

    I’ve checked a couple of your other posts, so I’m assuming you can do a bit of code. apologies if this gets to technical.
    And please let me know if it is technical. And we will try another way to help.

    The theory

    What probably is going on is a other plugin or theme is saving the DFI image id in post meta (meta_key:_thumbnail_id).
    Can you confirm this by running the following query?

    SELECT * FROM wp_postmeta WHERE meta_key = '_thumbnail_id' AND meta_value = 777; 

    Replace 777 with the DFI image id. And you probably have a different prefix than wp_ on your postmeta table.

    If you get a bunch of results. Then this theory is correct.

    The easy fix

    If this is the case you can easily delete these by running:
    ⚠ Always create a backup of the database before editing mysql⚠

    DELETE FROM wp_postmetaWHEREmeta_key= '_thumbnail_id' ANDmeta_value` = 777;

    Again, replace the 777 and the prefix.

    Finding the source of the problem

    Does the DFI show on new posts (with the plugin enabled)?
    And how does it show with the plugin disabled?

    Can you test this with Divi and an other theme?

    Let me know how it goes.
    And also let me know if this is to difficult.

    Jan-Willem.

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hi Elaine,

    Yes this is possible, with a bit of custom code.
    In your wp-content/plugins/ folder create a file named: dfi-random.php
    With the following code:

    <?php
    /**
     * Plugin Name: Default Featured Image - Random post image
     * Plugin URI:  https://wordpress.org/support/topic/multiple-featured-images-6/
     * Version:     1.0
     */
    
    add_filter( 'dfi_thumbnail_id', 'dfi_random_image', 10, 2 );
    function dfi_random_image( $dfi_id, $post_id ) {
    	if ( get_post_type( $post_id ) !== 'post' ) {
    		return $dfi_id; // This is not a post, we only check posts.
    	}
    	$random_image_ids = array(
    		123, # Add your image id's in this array.
    		456,
    	);
    
    	return $random_image_ids[ array_rand( $random_image_ids ) ];
    }
    

    Replace the example image ids (123, 456,) with your own image ids.
    You can find the image ids in the media library when you open an image and check the url.

    After you change the id’s don’t forget to activate the plugin.

    If you need any help let me know.
    Jan-Willem

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hi lexienoelle,

    I’ve taken a better look. Did you delete the Default featured plugin?
    Because it does not appear to be part of your site.

    Default featured image doesn’t really effect the social share image. As I
    said, that’s usually handled by the theme or SEO plugins.

    Still I can give you a couple of pointers:
    You can use https://socialsharepreview.com to check your image (and text).
    I see your site uses Genesis Open Graph. Here is the official documentation about that.

    Hope this helps!

    Best
    Jan-Willem

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hi lexienoelle

    this doesn’t ring a bell. I’m currently on a vacation in Athens, so I’ll have a better look next week.

    Something background the social share image is usually picked by the theme or SEO plugin. They will find the DFI if no featured image is set.

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hi,

    Can you explain what the problem is?
    What happens, what do you expect to happen?

    I don’t have the WPML plugin so testing this will be hard.

    Let me know,
    Jan-Willem

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Here are two sites that can check the social share preview.

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hello,

    The short answer is probably .
    This will depend on the theme and/or SEO plugin.
    If there is a place where the featured image would be used. DFI will fill it in if missing.

    So google/social share will look for both regular images and <meta property="og:image" tags in your HTML.
    So if your theme/SEO plugin adds that, DFI will automatically do it’s job.

    Hope this helps you.
    Let me know if I can do anything else.

    Jan-Willem

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hi Elaine,

    Good to hear you’ve managed to solve it!
    I’m not familiar with metaslider, but sometimes these slides can be there own custom post type.
    And you might want to exclude or make exceptions for those.

    But if you need any help just let me know,

    Best,
    Jan-Willem

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hello,

    Can you specify where you would expect the DFI?
    I don’t see any obvious places. Even on the news page all posts appear to have images.

    Let me know,
    Jan-Willem

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hello Manuel,

    Yes the snippet will still work.
    So many people use these snippets, I’ll never break them.
    I consider them as vital for use as it’s main feature.

    Jan-Willem

Viewing 15 replies - 16 through 30 (of 455 total)