• Installed on my blog and I have tons of featured images that doesn’t suit very good with this the new image generated.
    It is possible to have a global flag to disable that behaviour?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Internetbureau Clearsite

    (@clearsite)

    In the general settings you should find a checkbox labeled “Use the WordPress featured image”. Disabling this will remove the featured image from the consideration process. The selection process will then be
    1. “Image selected at a post”
    2. “Image selected with Yoast SEO” (if installed)
    3. “Image selected in the general settings”.

    Thread Starter Daniele Scasciafratte

    (@mte90)

    I saw with the update the new flag but this doesn’t fufill my needs.
    I want that globally it is used the featured image without the text on it and only in the new articles I will flag manually the new social image.
    In this way I don’t break old stuff.

    Also I see that this adds automatically in the image the article title and my website name. So it is like “why this article is cool – My website name” but it isn’t possible to avoid to add that last suffix.

    Plugin Author Internetbureau Clearsite

    (@clearsite)

    If I understand correctly, you would like to be able to disable BSI unless you turn it on.
    Currently, it is on unless you turn it off.

    That is not possible at the moment, but I will add it to the list.

    the suffix ‘- My website name’ is because that is in the actual title.
    You can implement a filter ‘bsi_text’ to remove it;

    either place this in your theme’s functions.php:

    add_filter('bsi_text', function($text) {
      return str_replace(' - My website name', '', $text);
    }, 100);

    or create an mu-plugin, for example wp-content/mu-plugins/bsi-filters.php, with content

    <?php
    add_filter('bsi_text', function($text) {
      return str_replace(' - My website name', '', $text);
    }, 100);

    You might need to create the wp-content/mu-plugins directory first.

    Plugin Author Internetbureau Clearsite

    (@clearsite)

    After discussing with the team, we will not implement a “default disabled” set-up soon.
    We will keep it on the feature list, but we have a limited amount of time each week for further development and support for the plugin, so we must prioritise.

    what I can offer you at the moment is a short piece of code;

    add_action('admin_footer', function() {
    	global $wpdb;
    	$post_ids = $wpdb->get_col("SELECT ID FROM {$wpdb->posts} WHERE post_status = 'publish'");
    	$meta_key = '_bsi_disabled';
    	$meta_value = 'on'; // on = BSI disabled, off = BSI enabled
    	// query to remove ALL current values
    	$wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE meta_key = '$meta_key'");
    	// query to set BSI Enabled value for ALL POSTS 
    	foreach ($post_ids as $post_id) {
    		$wpdb->query("INSERT INTO {$wpdb->postmeta} (post_id, meta_key, meta_value) VALUES ($post_id, '$meta_key', '$meta_value')");
    	}
    });

    add this to your theme’s functions.php, or create an mu-plugin for it.
    then refresh the admin-page ONCE. (it does not hurt to do more than once, it just takes time)
    when the refresh is done (as in; the admin page is fully loaded), remove the code, or disable it by renaming admin_footer to disabled__admin_footer or something like that.

    Now remember, and for anyone else stumbling upon this; this snippet will set the BSI-disabled flag for all currently published posts of all types.

    When editing a post and deciding to use BSI, you can now enable BSI per post individually.
    When creating a new post, you will either need to disable BSI yourself, or use it :).

    Not the solution you were asking for, but hopefully it gets you where you want to go.
    If not, feel free to ask.

    Thread Starter Daniele Scasciafratte

    (@mte90)

    I don’t like so much this code.
    It is more easy to patch the plugin code to do the opposite.
    When I will have time I will look on that but I disabled the plugin for the moment.

    Plugin Author Internetbureau Clearsite

    (@clearsite)

    I guess you did not want the sneak preview ??
    A toggle switch is available in the settings to switch the default to off.

    “After discussing with the team, we will not implement a “default disabled” set-up soon.”

    Yeah, that did not age well ??

    Thread Starter Daniele Scasciafratte

    (@mte90)

    Cool!
    I was busy in this days too.
    Also I saw that if you open a preview article not yet published the title is not printed but there is “Page not found”.

    Plugin Author Internetbureau Clearsite

    (@clearsite)

    Yes, the Page not found issue …
    I know what causes it, but I have no solution yet ??
    The page fetches the title from the actual HTML, and as long as the page does not exist (never been saved), the title cannot be fetched.

    Thread Starter Daniele Scasciafratte

    (@mte90)

    In my case the post is saved but not yet published so is in draft.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Disable the feature image as background image’ is closed to new replies.