• Thanks RichardHarrison for your plugin, works well!

    Just a note for people who want to remove the link from carousel images. You have to change manually variables $prefix and $postfix in main.php (lines 100 and 101) and remove the html link.

    Actually it would be more logical to show images without links in the case all images come from the same post, don’t you think? In this case I would substitute lines 100 and 101 of main.php with this code:

    if (sizeof($postlist) == 1){
    	$prefix = '<li>';
    	$suffix = '</li>';
    } else {
    	$prefix = '<li><a href="'.get_permalink($att->post_parent).'">';
    	$suffix = "</a></li>";
    }

    On the other hand one could define a variable which defines if you want to have links or not.

    http://wordpress.org/extend/plugins/carousel-of-post-images/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thanks for this code.
    I use custom urls on the individual images I would like to link to.
    I use this plugin for that http://bit.ly/fx1adi
    How can I edit your code to use that url instead?

    THX @gerital

    But how to place links to full size images (fancybox plugin installed) instead of links to post? I can’t find the answer anywhere. By default it links to random posts. I’d like to place carousel with thumbnails (and links to full size images)fo each of my posts.

    Edit main.php and replace code between:

    $url = $image_src_array[0];
    and:
    $suffix = "</a></li>";
    with:

    $alt = get_post_meta($att->ID, 'wp_attachment_image_alt', true);
    $imagelarge_src_array = wp_get_attachment_image_src($att->ID, large);
    $urllarge = $imagebig_src_array [0];
    
                    if ($url != "")
                    {
    $image_title = $att->post_title;
    $caption = $att->post_excerpt;
    $description = $image->post_content;
                        $prefix = '<li><a href="'.$urllarge.'" title="'.$image_title.'">';
                        $suffix = "</a></li>";

    This way you’ll have the thumbnails linked with each large image (using lightbox will resize it to fit screen if necessary), appropriate alt text and title for each one.
    Hope it helps.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Carousel-of-post-images] Remove link from images’ is closed to new replies.