When you add an image with caption to the WP text editor, it should add a caption shortcode. Is that the case here?
From there the output html should have some default classes like wp-caption
.
You can then style your caption by applying some CSS to these classes:
/* The wrapper <div> for the caption and captioned element. */
.wp-caption { }
/* The caption text. */
.wp-caption-text { }
/* An image within the caption (you might want to style other elements too). */
.wp-caption img { }
See here: http://justintadlock.com/archives/2011/07/01/captions-in-wordpress
Alternatively you can customize the html output using the caption shortcode hook.
Related Posts:
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- Is it ok to use a function to output the text domain name in a wordpress theme
- TinyMCE custom styles remove class when switching styles
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- Return only top-level navigation items from a menu using wp_get_nav_menu_items
- Overriding core functions in child theme
- Add inline css to theme
- Dequeue Scripts and Style for Mobile not working?
- get_the_excerpt() not returning anything when post has no excerpt
- Displaying Widgets
- Function to show only first instance of shortcode
- Automatically insert php function into post $the_content
- Best way to programatically add “rel” attributes to page and post images
- Add external js file to footer with id
- How to add background image control to page admin controls?
- Best Practice for Syncing Local Development With Staging Development [closed]
- How to use thumbnails in gallery?
- Logic to Print/echo a css class only for 1st post and ignore all post after 1st? [closed]
- Searching for content post
- When using wp_enqueue_script(); in a theme why don’t we use add_action?
- How to use Internationalized human_time_diff() function in Chinese?
- is_dynamic_sidebar always returns true while using Jetpack visibility
- Getting Featured Image Caption to Only Show if Populated
- Adding HTML to the end of every post with the Block Editor
- Why does the ‘wp_nav_menu’ function work only until a menu is created?
- Override a theme function in a child theme?
- How to add ‘data-caption’ inside an anchor tag
- Pulling Twitter RSS feed not working as expected (fatal error)
- Removing permalink from post thumb in twentyeleven
- Use register_setting() in a loop
- Best practices regarding the creation of custom widgets?
- Add dynamic links in WordPress custom theme
- WordPress menu link doesn’t work properly
- Search filter by Post title OR Meta Title Value [duplicate]
- how can I edit flexslider in woocommerce. [Urgent]
- admin-ajax.php + load-scripts.php hanging for minutes
- Unique sequential reservation code
- Usage of theme name in functions
- Functions.php Problem
- ACF not showing
- How to customize the_archive_title()? Cannot figure out how to change the value it produces [duplicate]
- Control the srcset much more (not all sizes in it each time)
- Way to store featured image width and height in two separate variables?
- Insert template-part inside the content
- Remove links from the_content when using filters wp_trim_excerpt
- Excerpt for pages not showing
- Some questions about how proper add 2 CSS file in a WordPress theme?
- How do I pull excerpts from pages?
- Does size of a theme’s functions.php file matter?
- Functions php shortcode for displaying main menu with no child items
- get_next_posts_link() returns no result despite available posts
- Nav menus all outputting the same links
- does wp function the_content(); accept another tag inside
- PHP 7.1 | Warning: A non-numeric value encountered in
- How to insert class in each list of categories?
- I can’t add CSS with functions.php
- The_content and Preg_replace in loaded Iframe [closed]
- Combine two active_callbacks into one on theme customizer
- first paragraph of the_content as meta description
- get_terms (or tax_query) for term of current post?
- WP Customizer API loaded into functions.php
- call_user_func_array() expects parameter 1 to be a valid callback, function
- why can’t i add front.css to my frontpage.php
- Changing where my author box is printed
- Single.php the_excerpt loads same as the_content not loading read more line
- Is this an acceptable practice for WordPress theme development?
- Rewrite Question Mark in Post Template with URL Parameter for clean URLs
- Insert a field with PREG_REPLACE – strange behaviour
- contact form in template with jquery,validate and ajax
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Woocommerce Variable Product Dropdown for Custom Shop Template
- How to fix Function create_function() is deprecated in / themes
- Advanced method to control cache of enqueued style/script
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- Is_Page doesnt detect my page
- Test CDN link from function.php or wp_enqueue_script/style?
- How to customize archive widget only for cpt?
- wp_title() return random number
- How to offset main query without affecting other queries and backend
- How to display different blocks for mobile and desktops
- Using AJAX on frontend: Synchronous XMLHttpRequest deprecation except for admin role
- Add meta data in head from theme
- what is `get_section()` and how to use it?
- HowTo: Add wrapper to columns shortcode?
- How to create admin ajax function for my contact form
- How to disable site title and description when custom header is uploaded on the customizer?
- Shortcode to eliminate and replace with
- Function the_content
- Load a Child Theme’s style.css just before the closing tag
- Remove Captions from Custom Gallery function.php
- Allow tags and attributes in post and pages content
- Dynamically adding Captions to images
- How accomplish modification the_content if home/start page?
- Add the title of a widget as an ID – for anchor links
- Show stuff everywhere except single post?
- Why functions metaboxes is causing White Screen in Admin [closed]
- Getting error on function.php
- Creating mixture of shortcodes to use in the visual/text editor
- How I can show short content with short tag
- Setcookie not setting cookies anywhere except admin