WordPress.org

Ready to get started?Download WordPress

Forums

Amphion Lite
Cannot Add Links to Images (11 posts)

  1. Dave333
    Member
    Posted 3 years ago #

    There seems to be no way of adding a link to an image in the body of a page.

    Adding the usual code doesn't work:

    <a href="http://www.link.com"><img src="http://www.imagelocation.com/image.jpg"></a>

    If someone clicks on this image all they get is a small black box with a spinning circle in it, like it is trying to load something.

    However, linked images work fine in widgets on the sidebar.

    I am using the Amphion Lite theme with no plugins installed. If I change the theme to any other theme the problem doesn't exist.

    So, is there some javascript code in Amphion Lite that is preventing images from being used as links on the body of a page?

    If so, how do I change it to allow images to have functional links behind them?

  2. Dave333
    Member
    Posted 3 years ago #

    I found the problem.

    As I suspected, there was a nasty bit of js in the file amphion.js that was preventing any image links.

    Here is the code that you need to remove to make images clickable:

    jQuery('#single_posts .post_mid .post_content_main a').has('img').addClass('hasimg');
    	jQuery("a.hasimg").fancybox({
    		'transitionIn'	:	'elastic',
    		'transitionOut'	:	'elastic',
    		'speedIn'		:	400,
    		'speedOut'		:	200,
    		'overlayShow'	:	true
    	});
  3. iphoneglance
    Member
    Posted 3 years ago #

    hey, is it possible for you to tell me exactly where to go to remove these codes. im having the same issue on my blog iosappfinder.com. Thanks for help in advance.

  4. Dave333
    Member
    Posted 3 years ago #

    Gladly,

    It is in the javascript file called: "amphion.js" which can be found in:

    wp-content/themes/amphion-lite/js/amphion.js

    Find that code near the top of the file and delete it. You can open the file in notepad or and text editor. Once deleted you'll find that you can then have image links.

  5. iphoneglance
    Member
    Posted 3 years ago #

    i seem to be completely lost, how do i get to the wp-content/themes in the first place?

  6. Dave333
    Member
    Posted 3 years ago #

    You need to access the file structure via FTP.

  7. iphoneglance
    Member
    Posted 3 years ago #

    hi never mind about my previous message. i know i have to access it through my server. i have successfully remove those codes but i still get the small black box with the spinning circle.

  8. Dave333
    Member
    Posted 3 years ago #

    I just tried one of your pages and I am also getting the spinning circle in the black box.

    So I went back to my page and put the code back into amphion.js. I got the spinning black box again. So I removed the code from that file and it is now gone and loading links fine.

    So it is definitely the code that is doing this. Just not sure why it is not working for you.

  9. iphoneglance
    Member
    Posted 3 years ago #

    Never to worry, you have been great help. i will have to play with the code a bit more. i edited the code directly from the file manager on my server and not through notepad or any text editor, but i dont think it matters how the codes are remove just as long as they are. Thanks again

  10. robertmista
    Member
    Posted 2 years ago #

    Hey iphoneglance,

    Did you ever get this to work?

    Because I am having the same problem. I removed the script and played around with it but I still can't get it to work.

    Any help would be much appreciated.

    Thanks in advance,
    Robert

  11. Claudia
    Member
    Posted 2 years ago #

    @Dave333 - Thank you, Dave! You are a genius! ;)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic