Title: Custom post problem
Last modified: August 31, 2016

---

# Custom post problem

 *  [msbsally](https://wordpress.org/support/users/msbsally/)
 * (@msbsally)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/custom-post-16/)
 * Hi all,
 *     ```
       <?php
       $loop = new WP_Query("p=272&post_type=HoverImage&post_status=publish");
       echo $loop->the_post();
       <center><?php echo '<img src="'.get_field('normal_image',get_the_ID()).'"/>';
       ?></center>
       <?php
       if(hover){
       //echo '<img src="'.get_field('hover_image',get_the_ID()).'"/>';
       }
       ?>
       ```
   
 * this is my code i am viewing the image from custom field , now i want another
   image while hover the image.
    inside “if()” what condition should be put?? if
   any help provide it’ll helpful for me. Thanks sallu.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/custom-post-16/#post-7431174)
 * Firstly, this post should probably be moved, as this isn’t really a request or
   feedback. One of the mods here will be able to help with that.
 * For your problem, you can’t do hover effects with PHP. PHP is a server-side only
   language, so it doesn’t have any ability to interact with a browser like that.
 * To do a hover like that you’d need to have either CSS, JavaScript, or a mix of
   the two.
 *  Thread Starter [msbsally](https://wordpress.org/support/users/msbsally/)
 * (@msbsally)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/custom-post-16/#post-7431175)
 * [@catacaustic](https://wordpress.org/support/users/catacaustic/)
 * First of all thanks to look into my question. I am changing html template to 
   wp site so i have a request that while hovering on a image which bring from custom
   field should be changed. how do i do this?
 * Thanks Sallu.
 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/custom-post-16/#post-7431180)
 * As I said, use CSS, JavaScript or a mix of both depending on how you want it 
   set up. There’s (literally) 1,000’s of tutorials, code snippets and information
   sites out there, so do a bit of research and see what method suis your own purpose.
   Just remember that PHP can’t do the effect (you’ll need CSS or JS), but it can
   set up the HTML that’s needed by which ever system you choose.
 *  Thread Starter [msbsally](https://wordpress.org/support/users/msbsally/)
 * (@msbsally)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/custom-post-16/#post-7431307)
 * Thanks,
 * Sallu

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Custom post problem’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [msbsally](https://wordpress.org/support/users/msbsally/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/custom-post-16/#post-7431307)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
