Support » Plugin: W3 Total Cache » Disappearing featured image selection

Viewing 8 replies - 1 through 8 (of 8 total)
  • Same here. Everything works until I activate the w3 total cache.

    Okay, I found a solution to this. My theme has a setup where i include a file that contains the featured post – snippet.

    This was in my functions.php:

    require_once('library/featured_post_snippet.php');

    The featured_post_snippet.php contained this:

    if ( function_exists( 'add_theme_support' ) ) {
      add_theme_support( 'post-thumbnails' );
      set_post_thumbnail_size(90, 90, true);
      add_image_size( 'some_size', 1000, 9999, false ); //300 pixels wide (and unlimited height)
    }

    The setup above broke my featured posts when I activated w3 total cache.

    When I moved the exactly same code straight to the functions.php, everything works okay again. Hope this helps, seems like a minor bug in w3 total cache.

    My theme is based off of Bones, which uses a secondary file for (bones.php) for add_theme_support().

    I’ll see if I can move that section over to functions.php without any hiccups.

    Thanks a ton for figuring that out, you just saved me some serious time Niklo.

    I tried moving that all back to functions.php and it didn’t effect anything in terms of the featured image selection reappearing. Thanks for the input though.

    I’m using bones too, with the same filestructure, so this should be a solution for you too.

    <?php
    require_once('library/bones.php');
    require_once('library/custom-post-type.php');
    require_once('library/admin.php');
    
    if ( function_exists( 'add_theme_support' ) ) {
      add_theme_support( 'post-thumbnails' );
      set_post_thumbnail_size(90, 90, true);
      add_image_size( 'suuri_vaaka_sixteen_col', 1000, 9999, false ); //300 pixels wide (and unlimited height)
      add_image_size( 'pieni_vaaka_sixteen_col', 622, 9999, false ); //300 pixels wide (and unlimited height)
      add_image_size( 'pieni_vaaka_three_col', 181, 120, true ); //300 pixels wide (and unlimited height)
      add_image_size( 'pieni_vaaka_two_col', 118, 9999, false ); //300 pixels wide (and unlimited height)
      add_image_size( 'pieni_vaaka_two_col_pysty', 118, 168, true ); //300 pixels wide (and unlimited height)
      add_image_size( 'pieni_vaaka_mini', 55, 35, true ); //300 pixels wide (and unlimited height)
      add_image_size( 'pieni_vaaka_mini_pysty', 55, 80, true ); //300 pixels wide (and unlimited height)  
    
      // additional image sizes
      // delete the next line if you do not need additional image sizes
      add_image_size( 'category-thumb', 300, 9999 ); //300 pixels wide (and unlimited height)
    }
    ?>

    My exact code (that works) is above. Please try it, to see if it works for you!

    Thanks for your assistance niklo, but the same issue remains.

    Oh, I see what I did different. I have my add_theme_support and add_image_size sections in a function that wasn’t registering with the plugin enabled, where as yours is contained in an if statement.

    When I switched to an if statement like yours everything works fine.

    Thanks for your time!

    Good to know that you got it fixed!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Disappearing featured image selection’ is closed to new replies.