No need for plugins or any change to the markup – you can do all of this in pure CSS with what is called counters, which do have broad browser support.
body {
counter-reset: imageLabel;
}
.wp-block-image::before {
counter-increment: imageLabel;
content: "#" counter(imageLabel);
}
This will already produce the number after the image, you can style the ::before
however you like and position it where it needs to be.
Beware that this might hurt the accessibility of the page, I’m unsure how well screen readers can interact with both ::before
and the CSS content
. However, solving this will probably require you to create either a new block or edit the image block .
Related Posts:
- How to upload and style svg logo?
- Adding custom html/css/images to Theme
- Theme files and imagesnot loading on a mobile device
- I am having trouble displaying an image at the top of a widget area [closed]
- Getting Images from theme’s directory in pages
- How to reference a theme image in a stylesheet?
- Making WordPress Gallery (.gallery-item) Responsive?
- I’m trying to add an image in my CSS
- Creating a rotating header /image slider using theme customization
- Adding HTML within an image title attribute
- Width 100%: Aspect ratio of image
- Add CSS class to every image
- How to Make WordPress Default gallery responsive on mobile?
- Responsive background images added inline
- @wordpress/create-block image url in css
- Screenshot.png not showing up
- How can I upload an image for background use using the Theme Editor in WordPress?
- Any specific reason why images do not show on site?
- Override img class in gallery
- Multiple amp-image overlays. How to properly do this in wordpress?
- Image not shown in the theme as it’s showing in HTML template [closed]
- How to handle a background-size: cover image in WordPress?
- Background-image not showing? [closed]
- How to add an image to the post preview in the free theme “food recipes”
- Divi Theme – images not showing on front page [closed]
- Problem Cropping Images From WP Customizer
- t5-fresh-editor-stylesheets.php breaks image placement in WP Beta 3 editor
- How can I display an image description, from an image gallery?
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- How do I get my main image to stretch the full length of the screen?
- I have no images in an activated wp theme
- css to fit image by HEIGHT
- How to implement CSS-defined images from bootstrap site in wordpress theme
- a: hover issue with image issues [closed]
- All 3?: Responsive resizing of images + image width of actual image for small images + max-width for all larger images
- Moving an image to the side [closed]
- Image Captions Have a 10px Extra Margin, And It’s Not CSS? [duplicate]
- Can i have 2 separate Galleries on 2 separate pages each go to a DIFFERENT Attachment.php file?
- How to get rid of undefined variable in previous post image
- Image modification
- How to remove image size inline style in article and include caption
- Is there a layout to place 2 same sized images in two columns on the WordPress page?
- Landing Page with HTML CSS JS and Images on wordpress
- How can I change the header on the pages?
- DIVI Theme customizer changes not applied on existing pages and designs are not shown on the front
- WordPress does not load most theme images
- How to change a theme’s footer image
- Site only working in browser where I created it
- How to change background image
- Image sizes reset when changing theme
- WordPress and Advanced Custom Fields and Flickity
- Change header image size
- Is there a way to create referable automatic numbering in image captions?
- Why do images inserted in the post content via the_content() go off the max-width?
- How can we achieve this image css style?
- Remove image border in twentyeleven theme [closed]
- How to display posts with images in fullscreen slider
- Using a full-width hero image that can be changed in the dashboard by a user
- Put image onto header
- Are WP images responsive by default?
- Image thumbnail on single product issue | WooCommerce
- Background image call problem
- Featured images are cropped on index and post page
- all images of past post messed up after changing theme
- How to add multiple images in a page
- Custom styling Insert Media window
- Display ajax preloader for large images within posts
- An image on my site is showing as the wrong image [closed]
- Is there a good way to use CMS images with CSS
- change with CSS the color of an svg background image set with “background-image: url()”
- How do I change a Themes Header Image?
- Stop underlining image links
- Font size on image captions on mobile
- Parallax image problem
- Theme using masonry layout script rendering overlaped images in Google Chrome [closed]
- What type to upload image within theme options?
- Why is inline CSS added to images automatically? [closed]
- Create decorative image border with CSS? [closed]
- How to get customable image header?
- WordPress Theme: replace logo image with title site if file doesn´t exist on server
- WordPress update leads to 404 error on admin page and signup. CSS mishap with all plugin related functions
- Is there a way to add background-image to theme.json?
- Using Featured Image as Hero Background in Word Press
- WordPress Site Broken and it gives Headers Already sent error
- Default Image Link Removal
- How to copy and paste a picture found on the web to wordpress easily
- Graphing libraries for WordPress [closed]
- custom image size with New Media Manager in wordpress 3.5
- Images will not display, when I call them up with html in wordpress, just two blank small spaces [closed]
- Fixing image names for a site being restored
- Images not showing in media grid view (but showing in list view)
- How to use getimagesize() of image upload?
- photo gallery implementation like tmz
- How to join Caption AND Description Meta Fields as one combined-caption in Image Block
- How to avoid images appear as post in google search?
- Generate links on all images in posts – is there a hook?
- Images use & location, on new wordpress theme
- Broken image URL
- Image not showing in an archive page
- Remote Image (from URL) as Media Library element