Results 1 to 5 of 5

Thread: Quick Tut! - Moving images

  1. #1
    Thread Starter
    Veteran pointandstare's Avatar
    Join Date
    Apr 2009
    Location
    London, England
    Posts
    311
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Quick Tut! - Moving images

    Some people have asked how to place the images elsewhere on the page.

    In single.php -

    Look for
    Code:
    <h3><?php _e('Images','cp'); ?></h3>
    					<p class="prdetails">
    					<?php if(function_exists('classi_lightbox')) {classi_lightbox(get_post_meta($post->ID, 'images', true)); } ?>
    					</p>
    Simply cut and paste this to wherever you want to display the uploaded images.

    Of course, it's best NOT to edit core files and I hold no responsibility for any problems caused by using this Quick Tut!

  2. #2
    Founder dcowgill's Avatar
    Join Date
    Mar 2009
    Location
    San Francisco, CA
    Posts
    1,939
    Thanks
    66
    Thanked 135 Times in 99 Posts

    Re: Quick Tut! - Moving images

    Cool...thanks for sharing. If anyone ends up using these tips, please make sure to thank the author!

  3. #3
    sergiv's Avatar
    Join Date
    May 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Quick Tut! - Moving images

    Hey, that's good!

    And if I want to use only the first image as the Main image in the begining of the classified ad? (Keeping the rest down on the page.

    Thanks in advance!

  4. #4
    sergiv's Avatar
    Join Date
    May 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Quick Tut! - Moving images

    Ok I got it:

    On "functions.php" put this text:

    function show_one_image ($images) {
    $matches = explode(",", $images);
    if ($matches[0] != "") {
    $thumb_var = str_replace(get_option('home')."/wp-content/uploads/classipress/", "", $matches[0]);
    $single_thumb_img_url = get_bloginfo('template_url')."/includes/img_resize.php?width=150&amp;height=150&amp;url=". $thumb_var;
    echo "<a href=\"$matches[0]\" rel=\"group\"><img src=\"$single_thumb_img_url\" class=\"size-thumbnail\" alt=\"".get_the_title()."\" title=\"".get_the_title()."\" /></a>"."\n";
    } else {
    if ( $matches[0] == "") {
    _e('There are no images','cp');
    }
    }
    }


    Now on "single.php" this on where you want it to appear:

    <h3><?php _e('Images','cp'); ?></h3>
    <p class="prdetails">
    <?php if(function_exists('show_one_image')) {show_one_image(get_post_meta($post->ID, 'images', true)); } ?>
    </p>

  5. #5
    Junior Member johare's Avatar
    Join Date
    Mar 2009
    Location
    United States
    Posts
    48
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Re: Quick Tut! - Moving images

    Cool -I'm putting the images above the description and this is very helpful!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)