Skip Navigation

[Resolved] Image Swap on hover

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 10 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 3 voices.

Last updated by katrina 10 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#118638

Is there anyway I can set it up so that a user can upload two images (one active, one rollover) and having the rollover image appear when the user hovers over the image?

#118875

Hi vytenisK,

It is possible by adding another plugin "Hover Image":
http://wordpress.org/plugins/hover-image/

I have tested in my localhost, please try as following steps:

1) I assume you are using Types to create the two images:
one active, is using slug "active"
one rollover, is using slug "rollover"

2) download the plugin from wordpress:
http://wordpress.org/plugins/hover-image/
install it in your website

3) edit the plugin file hover-image.php
add a line in line 31:

function himage($atts, $content)
{
	$content = do_shortcode($content);
...

4) add shortcodes in your post content as this:

[himage][types field="active" align="none"][/types][types field="rollover" align="none"][/types][/himage]
#119174

Where do I add the shortcode? I tried putting it in my .php file but it didn't work.

#119208

And is it definitely

$content = do_shortcode($content);

And not

$content = do_shortcode("content");
#119257

I figured it out. You were right, I just forgot to put the the content function into my php file (new to WP). Thanks!

#119271

Actually, one more question. If I add a URL field in types as well (so the image links to a site), how would I do make the image link? Would t hat be done through the shortcode, or would have have to wrap

<?php the_content(); ?>

in an 'a' attribute?

#355960

Hello, I know this is a very old thread. Is this still the preferred method for adding a hover state that utilizes a Types custom field in a View?

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.