WordPress.org

Ready to get started?Download WordPress

Forums

[WP Content Slideshow] custom image size (4 posts)

  1. Chris Demetriad
    Member
    Posted 2 years ago #

    This gets the photos from the slideshow:

    <li id="main-post-<?php echo $counting;?>" onmouseover="this.style.cursor='pointer'" title="<?php the_title(); ?>">
    <img src="<?php echo $thumb;?>" /></li>

    $thumb is set up just before that:
    $thumb = get_generated_thumb("content_slider");

    and the function from some other file is:

    function get_generated_thumb($position) {
    	$thumb = get_the_post_thumbnail($post_id, array(389,254), $position);
    	$thumb = explode("\"", $thumb);
    	return $thumb[5];
    }

    How do I make it display a certain image size? I've got set up the ones I need in functions php. The reason is, the slideshow just resizes it, therefore is using a much bigger photo.

    I need that bigger as it is as I have some other parts where I am using it as a big image, but I would like to use a custom size and I simply don't get it from get_the_post_thumbnail

    Thank you.

  2. Chris Demetriad
    Member
    Posted 2 years ago #

    I've also tried:

    get_the_post_thumbnail($post_id, 'slideshow', $position);

    as I have it set up in functions.php:

    add_image_size( 'slideshow', 389, 254 );

    I just don't understand and it's extremely frustrating.

  3. Chris Demetriad
    Member
    Posted 2 years ago #

    Any thoughts please?

  4. zentralheld
    Member
    Posted 2 years ago #

    try

    <?php echo get_the_post_thumbnail($post_id, array(100,50) ); ?>

    it has worked for me :)
    e.g.:

    <li class="on clearfix" id="post-<?php echo $counting; ?>">
     <a href="#main-post-<?php echo $counting; ?>" title="<?php the_title(); ?>">
     <span class="slide-thumb"><?php echo get_the_post_thumbnail($post_id, array(100,50) ); ?></span>
     <?php echo cut_content_feat(get_the_title(), 50, ""); ?>
    </a>
    </li>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.