php - Link an image on the front page to post, but when the post is open link to the image. (WordPress) -


i have wordpress blog: http://technosting.com/

on homepage each post has image before it, image linked post. when post opened same image still linked post url. use fancybox plugin makes gallery of photo linked self. example @ of other images inside post, excluding first image of coarse. on front page image linked blog post when blog post opened, image link self fancybox can used view image. looked hours online not able find solution this. how can make work?

thanks in advance,

what want here, is_single().

add in functions.php

function enqueue_fancybox(){     wp_enqueue_script('my_custom_js', '/path/to/my/custom.js', array('jquery', 'fancybox')); }  if(is_single(){     add_action('wp_head', 'enqueue_fancybox');     } 

where custom.js calls code required create fancybox. code indicates has dependency on enqueued scripts jquery , fancybox

this ensure it's not fired on front page, it's pulling list of multiple posts, because is_single() return false, , conditional expects true.


Comments

  1. Casino Slot Machines - MapyRO
    Casino 나주 출장마사지 Slot Machines. $0.99. In stock. No. Slot Machines. 동해 출장샵 Open box: No. 당진 출장샵 Min. 원주 출장마사지 bet: 0.00. Game type: 진주 출장샵 Casino.

    ReplyDelete

Post a Comment

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -