WordPress.org

Support

[Resolved] Show thumbnail

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Scott Kingsley Clark

    @sc0ttkclark

    Try this:

    echo pods_image( $pod->field( 'your_file_field' ), 'thumbnail' );

    Thanks for your reply. However, this does not work with my Pod Page / Pod Template setup. Its about your code above.

    My Pod Page:

    <?php
    $pods->find();
    
    echo $pods->template('categorie_block');
    while($pods->fetch()){
        echo $pods->template('categorie_block');
    }
    ?>

    Pastebin Variant: http://pastebin.com/r8UQWSns

    My Pod Template ‘categorie_block’:

    <div class="categorie-block-wrapper">
    	<div class="categorie-block">
            <h2>{@naam}</h2>
            <img border="0" src="<?php echo pods_image( $pods->field('afbeelding'), 'thumbnail' ); ?>" width="100" height="100"/> // does not work
        </div>
    </div>

    PasteBin variant: http://pastebin.com/naxLd8GR
    Of course I have tried different combinations:
    echo pods_image( $pod->field(‘afbeelding’), ‘thumbnail’ );
    echo pods_image( ‘afbeelding’, ‘thumbnail’ );
    echo pods_image( ‘{afbeelding}’, ‘thumbnail’ );

    Btw: About this Pod Page and Pod Template combination is this bug report on Github: https://github.com/pods-framework/pods/issues/1244

    Ah, I have found it with get_definded_vars().

    I can use the $obj variable.

    So my Pod Template code changes to:

    <div class="categorie-block-wrapper">
    	<div class="categorie-block">
            <h2>{@naam}</h2>
            <?php echo pods_image( $obj->field('afbeelding'), 'thumbnail' ); // WORKS ?>
        </div>
    </div>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Show thumbnail’ is closed to new replies.
Skip to toolbar