Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4807
    Jon Beinart
    Participant

    Hi. I’m using “FancyBox” and even though I have enabled “Title show” my images are not showing any titles. The titles were showing when I was using “prettyPhoto” but I prefer the look of “FancyBox”. Can someone please check it out and let me know how to fix it. I hope the solution is not too complex as I am not very tech savy and I’m not familiar with coding. http://jonbeinart.com/gallery/toddlerpede-sculptures/

    #4819
    Bartosz
    Keymaster

    Jon, try pasting that to functions.php of your theme:

    function df_add_title_attachment_link($link, $id = null) {
    	$id = intval( $id );
    	$_post = get_post( $id );
    	$post_title = esc_attr( $_post->post_title );
    	return str_replace('<a href', '<a title="'. $post_title .'" href', $link);
    }
    add_filter('wp_get_attachment_link', 'df_add_title_attachment_link', 10, 2);
    #4843
    Jon Beinart
    Participant

    Thank you Bartosz! I have one more question. Is it possible to have the images (including border with text) automatically resize to fit the screen no matter how zoomed in the browser is?

    #4853
    Bartosz
    Keymaster

    The plugin itself doesn’t work that way. I think you’d have to use some custom Javascript for this.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.