If you want to append HTML to images, you want to look inside the template files. Search for something like the_post_thumbnail
function, and add your HTML right after the closing </a>
tag (if there is one). You’d then need to style it with CSS so that it’s only visible upon hovering the image.
For example, in twentyfifteen
theme (located inside /wp-content/twentyfifteen
in the file system), content.php
has a function (twentyfifteen_post_thumbnail
) which is defined in inc/template-tags.php
, and it’s used to display images on ‘single post’ pages as well as ‘post list’ pages.
If you’re after giving users an ability for album images to be shared (on Pinterest, etc.), it would be much easier to find a plugin that does this – there are quite a few, and you may just find one that has the effect you’re looking for.
Related Posts:
- Issue with get_theme_mod returning a blank value instead of the saved value
- Set default options for inserting media
- How do I change parameters without changing the core
- Post thumbnail relative link and HTML modify
- Save_post – Warning: Cannot modify header information
- How to use WP conditional tag in a functions.php with OCEANWP Theme?
- True email confirmation for registration (keeping unvalidated users from user table)
- Copy and Modified WooCommerce function is_coupon_valid [closed]
- jQuery does not work
- Why does re-using this function not work? [closed]
- Pass parameter to hooked function using custom page template
- different style sheet for just one page template
- Override the WordPress core function wp_referer_field
- How to return hook data when multiple parameters are present?
- Hook into a function without a hook?
- What is the text that appears beside the page titles in the list of pages in the WP admin?
- How to edit the Tags within the image file URLs?
- Condition OR for current user ID
- Is my code correct to enqueue CSS on a specific page?
- Can’t properly set the_title add_filter to show short_URL
- Control the srcset much more (not all sizes in it each time)
- How to retrieve the current post’s generated featured image size?
- How to add_filter html template to middle of content
- Filter yoast canonical add_action priority [closed]
- (Woocommerce) Order by price when entering specific category
- How do I hook into the container of wp_nav_menu?
- Remove links from the_content when using filters wp_trim_excerpt
- Custom Behavior when Adding New Custom Post Type in Dashboard
- Where do I store custom functions that call custom page template files?
- Plugin Development – Functions or Hooks?
- Why There Is No “get content by ID” Function
- Is there a way to prevent a function/method from being called outside a specific hook?
- Add an Outside Wrapper to my Header and Make it Full Width
- Custom HTML markup
- Auto log in hook is requiring a page refresh
- Use a shortcode to display custom meta box contents
- Wp-query Order By problem
- Possible to hook into Media Library preview File column and use a custom image?
- Function not working inside of a function in functions.php
- Create custom function for hero image
- Randomizing wp_tag_cloud() in child theme
- Adding code before post title with the_title produces weird results
- Add back in child theme what the parent theme removed with remove_action
- login_headertitle is deprecated since version 5.2.0
- How to append classname to body tag if guest user
- Writing a function to detect an event
- Where do I go to edit this area? [closed]
- Replace plugin function with a custom function?
- Add attribute only to first image of every post via functions.php
- Different favicon on different pages
- The_content and Preg_replace in loaded Iframe [closed]
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- WordPress wraps span tags into p tags
- Changing where my author box is printed
- Is it possible to use add_filter in an included file in the child theme’s functions.php?
- Insert Content Before div#main from the functions.php File
- Add Adsense code between job listings – wp job manager plugin
- Problem with images URL after filter applying
- two search forms on the same page
- Function to replace comment’s accented characters before posting
- update_post_meta is Updating with two page id
- Insert a field with PREG_REPLACE – strange behaviour
- How to echo Widget Title in Custom Frontend-Template Box
- Replace admin header logo with an image
- New checkbox in custom widget isn’t saving data
- Linking Javascript in functions.php file
- how to display a page before the home page
- loginout function customization
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- is_home() not working in functions.php file
- How to conditionally add a widget via a hook in functions.php
- How to place a div inside a function that creates a div
- Function to check if custom page is used by page?
- Changing the text of Upload/Insert on Posts and Pages Screen
- implementing a centralized content “show-do-not-show” toggle?
- How would I make a function to dynamically determine if user is logged to change navigation menu text?
- Filter for replacing the WP_query object for a given category
- How to display this meta data (an array) in form of a function (created with a custom write panel)?
- WordPress – using sessions?
- How to add or delete default value theme options while activate and deactivate theme
- WordPress comment processing . Default unapproved comments detection before posting
- Warning at top of website & top menu gone
- How to remove font awesome from loading in wp theme
- How to replace ACTION url from original wordpress login form?
- Header menu aligned right on all pages except for single-post page [closed]
- Does hook have an effect on increasing the page load?
- What is the earliest Hook a Script can use?
- Populate acf-field, depending on block name
- custom error message for empty username and password using authenticate filter not working
- Modifying a WordPress Plugin
- CF7 select value get to function and reciept value from function
- Hide author info in single posts by certain users
- External api call and make global variable for any page visitor enters , page-home, page, single etc
- How Do I Unhook This Parent Theme Function?
- CSS style and app.js not loading
- Get post_author email for Zapier Integration
- Parent category as WOOCommerce Categories widget title
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- Extend WordPress Audio Widget to accept HLS (.m3u8) URLs
- Shortcode to insert default text and change one word throughout it?