WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Using featured image with Allure theme (7 posts)

  1. montygothic
    Member
    Posted 3 years ago #

    Hi,

    I'm using the Allure theme and after researching the codex docs I'm still having trouble getting the featured images to post home page.

    I have added the following lines to function.php files:

    `add_theme_support( 'post-thumbnails' );

    has_post_thumbnail( $post_id );

    Here is a link to the page http://forms.1stti.me

    Any advice will be well received.

  2. montygothic
    Member
    Posted 3 years ago #

    Hey, I've tried to add the following but still no avail. I know I'm on the right track, any suggestions of tweaking this is appreciated.

    This to functions.php
    <?php add_theme_support( 'post-thumbnails' ); ?>

    &

    This to the home.php page.

    <?php if(function_exists('the_post_thumbnail')) { ?>
    <?php if(get_the_post_thumbnail() != "") { ?>
    <?php the_post_thumbnail(array(150,150), array('class' => 'alignleft')); ?>
    <?php } ?>
    <?php } ?>
  3. edriessen
    Member
    Posted 3 years ago #

    This is what I would do:
    I'd also ad this to the functions.php:

    add_theme_support( 'post-thumbnails' );

    If you have an thumbnail set I use the following code to load it inside the loop:

    the_post_thumbnail( 'large', array('class' => 'your_class_name_for_thumbnail_images') );

    OR (if you need large images)

    <?php the_post_thumbnail( 'thumbnail', array('class' => 'your_class_name_for_large_images') ); ?>

    Hope this helps

  4. montygothic
    Member
    Posted 3 years ago #

    Thanks edriessen, I tried this and the result is http://forms.1stti.me
    The image now appears! but I can't get it to appear in the homebox "Quadrant today".

  5. montygothic
    Member
    Posted 3 years ago #

    This site is using the same theme, http://www.susangreeley.com/

    They seem to have it sussed, anyone know how they did it?

  6. montygothic
    Member
    Posted 3 years ago #

    I fixed it now, phew.

    In functions.php I added

    add_theme_support( ‘post-thumbnails’ );

    Then I deleted some code which related to a thumbnail plugin specific to life before WP 2.9

    And replaced it with <?php the_post_thumbnail( ‘your_class’ ); ?>

    Last step was to add the following code to style.css

    .wp-post-image {
    float: left;
    margin: 0 10px 0 0;
    }

    Got there in the end

  7. edriessen
    Member
    Posted 3 years ago #

    Good to know it works now

Topic Closed

This topic has been closed to new replies.

About this Topic