I am using the advanced excerpt plugin for Wordpress http://wordpress.org/plugins/advanced-excerpt/ so I can display images and video's in my excerpts, as opposed to just text.
So my code is simply...
<?php the_excerpt(); ?>
Now if the excerpt is an image and text, I would like to make only the image tag an anchor link, not the text.
If I do this...
<a href="<?php the_permalink(); ?>"> <?php the_excerpt(); ?> </a>
...it makes the whole excerpt an anchor link as you would expect. The trouble with this is the paragraph text then inherits the link colour which I do not want, and if I disable this colour just for this excerpt, it also disables intended anchor links.
Is there any way I can do this in jQuery or PHP to select only the image in the excerpt and make it link to the corresponding blog post?
Thanks in advance