WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Flutter] Need Examples of Usage (7 posts)

  1. ninjaboy81
    Member
    Posted 5 years ago #

    Hey guys anyone have an example of how they succesfully got an image to display? Documentation is pretty poor for this plugin so far.

    What is the minimum amount of code need (everything included, the whole index.php or single.php files) to display an image from flutter on your post?

  2. m.a.payne@gmail.com
    Member
    Posted 5 years ago #

    Ditto.
    Same issue here.
    C'mon people. With all the "I love flutter" comments floating around, can't *someone* dumb it down for me?

  3. thepete
    Member
    Posted 5 years ago #

    I ditto the ditto.

    Seems like someone ought to be able to explain it step-by-step in text-form for those of us who find an audio-free video tutorial (like the one on the Flutter site) to be a bit too vague to trust our sites to. I'm intrigued, but not enough to march forward without knowing what's up...

  4. hakansson
    Member
    Posted 5 years ago #

    To display image and text in a post (single.php or index.php)

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php $image-variable = get_post_meta($post->ID, 'image-variable', true); ?>
    <h1><?php the_title(); ?></h1>
    <?php the_content(); ?>
    <?php echo get_image('image-variable'); ?>
    <?php echo get('text-variable'); ?>
    <?php endwhile; endif; ?>

    Just change the "image-variable" in the three places that's within the loop. If you have more images just add another <?php $image-variable = get_post_meta($post->ID, 'image-variable', true); ?> line with it's variable name and add its <?php echo get_image('image-variable'); ?>.

    If you want to put in more text fields, then add the <?php echo get('text-variable'); ?> were you want them to in the code. Remember to change the variable.

    These have to be within a loop:

    <?php echo get_image('image-variable'); ?>
    <?php echo get('text-variable'); ?>

    I hope I was clear enough. :)

  5. Brett
    Member
    Posted 5 years ago #

    I would like to say THANK YOU to hakansson! It's interesting they didn't use put the php after the <+?

  6. autumnelayne
    Member
    Posted 4 years ago #

    Thanks so much, hakansson! My juju is renewed after hours of trying to get this to work.

  7. DigitalTonic
    Member
    Posted 4 years ago #

    If I've got alot of flutter custom fields on a page I tend to use the get_post_custom() function, and then take the data where needed in the page.

    Example:

    <?php
    /**
     * Template Name: Project Page
     */
    	$maxImagesInRow = 5;
    	get_header();
    	$meta = get_post_custom($post->ID);
    	$imageCount = (isset($meta['thumbnail-image'])) ? sizeof($meta['thumbnail-image']) : 0;
    
    	if($imageCount > 0)
    	{
    		?>
    		<div class="project-images">
    		<?php
    		for($i=0;$i < $imageCount; $i++)
    		{
    			$do_split = (($i % $maxImagesInRow) == 0);
    			?>
    			<a title="<?php echo $meta['label-image'][$i] ?>" rel="lightbox" class="group<?php echo ($do_split) ? ' first' : ''; ?>" href="/wp-content/files_flutter/<?php echo $meta['large-image'][$i] ?>"><img alt="" width="82" height="82" src="/wp-content/files_flutter/<?php echo $meta['thumbnail-image'][$i] ?>" /></a>
    			<?php
    		}
    		?>
    		</div>
    		<?php
    	}
    ?>
    <?php get_footer(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic