Forums

Replace thumbs with text links in image.php (7 posts)

  1. japanwindow
    Member
    Posted 4 years ago #

    The default look in image.php has large thumbs below the image. I'd like to change this to simple text links (or small arrow.gif's). Can anyone tell me how to create text links that will a) link to the previous and next images, and b) only be visible if there IS a previous or next image?

  2. Glenn Ansley
    Member
    Posted 3 years ago #

    Hi, I've drafted a quick plugin to accomplish this. I'd appreciate any feedback. Find it here for now.

  3. neilb
    Member
    Posted 3 years ago #

    Hi, I've drafted a quick plugin to accomplish this. I'd appreciate any feedback. Find it here for now.

    This is perfect thanks a lot.

  4. alexleonard
    Member
    Posted 3 years ago #

    @blepoxp

    Really handy little plugin there :)

    I'd recommend adding a class to the plugin output, ie changing line 72 from:

    return "<a href='$url' title='$post_title'>$link_text</a>";

    to

    return "<a class="ft-text-image-link" href='$url' title='$post_title'>$link_text</a>";

    Or something like that. Just allows for easier styling if required (obviously I can surround it with specific divs etc, but no harm..)

    :)

  5. Glenn Ansley
    Member
    Posted 3 years ago #

    Great idea alex.
    I've updated the script and it's hosted in the WP Plugin repository now as well. http://wordpress.org/extend/plugins/text-for-image-navigation/

  6. grimmdude
    Member
    Posted 3 years ago #

    Hey all, I'm using 2.7 and this plugin works great. The only issue was the 'Next' and 'Previous' links were backwards. I just switched around the functions in the plugin like so:

    //This function calls the next link if next (WAS PREVIOUS) image exists
    		function ft_next_image_link($linkTitle) {
    			$this->ft_adjacent_image_link(true,$linkTitle);
    		}
    
    		//This function calls the previous link if previous (WAS NEXT) image exists
    		function ft_previous_image_link($linkTitle) {
    			$this->ft_adjacent_image_link(false,$linkTitle);
    		}
  7. grimmdude
    Member
    Posted 3 years ago #

    Hmmm wierd, it was working but now the links have switched back to the way it was...Disregard last post.

Topic Closed

This topic has been closed to new replies.

About this Topic