WordPress.org

Ready to get started?Download WordPress

Forums

WP-Imagefit - Very easy to make work with non-hAtom-based themes (ie Default) (1 post)

  1. SpencerLavery
    Member
    Posted 6 years ago #

    First things first, ensure your posts are wrapped in a block element that has a class, ie the "Default" theme wraps each post in a DIV with a class of "post".

    Open wp-imagefit.php and on line 20, change:

    jQuery('.hentry').imagefit();\n

    to

    jQuery('.post').imagefit();\n

    Obviously replace ".post" with the class you used in your HTML. I've only tested this on a custom theme and the Defualt theme but it seems to work fine for me.

    Hope it helps other people.

    Alternatively, if you'd rather edit your theme than the plugin, simply edit your theme templates to wrap each post in a DIV with a class of "hentry", ie.

    <?php while (have_posts()) : the_post(); ?>
        <div class="hentry">
            <?php the_content(); ?>
        </div>
    <?php endwhile; ?>

    (Sidenote to plugin author - excellent plugin, thank you for making it. At some point you could rewrite this so that the plugin autmatically injects a DIV around each entry in the loop with a class of "imagefit" then call that in the jQuery instead. Limiting this to hAtom only themes seems unneccesary to me.)

    http://wordpress.org/extend/plugins/wp-imagefit/

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 6 years ago by SpencerLavery
  • This topic is not a support question
  • WordPress version: 2.3.2