• Resolved zozopelli

    (@zozopelli)


    In colorbox, make the title a link to the post. The wordpress link needs to be dynamic. Colorbox is grabbing the thumbnail and title. How do I get it to add the url. The link would close the colorbox and open the post.

    I am learning and would appreciate if someone could point me in the right direction.

    Here is the jquery function from colorbox:
    $(‘a.gallery’).colorbox({title:function () {
    return “To view full size, ” + “click here!”.link(this.href);
    }});

    Thank you, Thank you for any help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • jquery may not work. have you tried contacting the plugin author?

    Thread Starter zozopelli

    (@zozopelli)

    Problem solved.

    1. used title=” ” to pass html link.
    2. hover displayed ugly title with html link. Added mouseover=”this.title= to display pretty title.
    3. mouseover stripped out html link. Added onclick=”this.title= to add back in html link.

    <a href="<?php echo wp_get_attachment_url($thumbID); ?>" rel="gallery" 
    
    onmouseover="this.title='<?php the_title(); ?>'" 
    
    onclick="this.title='<a href=&quot;<?php echo get_permalink(); ?>&quot;><?php the_title(); ?></a&gt'" 
    
    title="<a href=&quot;<?php echo get_permalink(); ?>&quot;><?php the_title(); ?></a&gt">
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘colorbox make title a link’ is closed to new replies.