WordPress mouse over text with background color?

I m new to wordpress and using 4.2.2 version. I need to show mouse over background color with text on image. The given text and images are generating dynamically from the admin panel. I have given the below images for your reference, first image right now im having my site, and next image I need to do like that.

enter image description here

Read More

enter image description here

Thanks in advance!

Related posts

1 comment

  1. You can use this function for wordpress

    <?php wp_get_attachment_image( $attachment_id, $size, $icon, $attr ); ?>
    

    or

    <?php wp_get_attachment_metadata( $attachment_id, $unfiltered ); ?>
    

    Here is the codex

    https://codex.wordpress.org/Function_Reference/wp_get_attachment_image
    https://codex.wordpress.org/Function_Reference/wp_get_attachment_metadata

    With this u can get the name of the image and show like the Sagar said

    You’ll use this in your page, not in yout functions.php

    U won’t be this in the functions, you’ll use this in your page, like this

    <?php 
         $my_query = new WP_Query('post_type=eventos&category_name=galeria_evento&posts_per_page=1');
                        while ($my_query->have_posts()) : $my_query->the_post(); 
                            ?>
    
                        <?php
                            $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                            $args = array(
                                            'post_type' => 'attachment',
                                            'post_parent' => $post->ID,
                                            'numberposts' => -1,
                                            'paged' => get_query_var('paged'),
                                            'exclude' => get_post_thumbnail_id()
                                        );
    
                       // making the list of the attachments
                            $attachments = get_posts( $args );
                            if ( $attachments ) {
                                foreach ( $attachments as $attachment ) {
                                // getting the image and title of the attachment
                                echo "<div class='item-slide'><p class='title-slide'>".apply_filters( 'the_title', $attachment->post_title )."</p>".wp_get_attachment_image( $attachment->ID, 'full' )."</div>";                                
                                }
                            }
                        ?>
    
    
                <?php endwhile; ?>
    

Comments are closed.