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
- How Do I Prevent Featured Image Caption Displaying Above And Below Image
- Issues with title-tag and document_title_parts
- Is it ok to use a function to output the text domain name in a wordpress theme
- Display random categories on the front page (Finding and Editing Theme Functions)
- How to get woocommerce inventory status [closed]
- Difference between the_content() and get_post()?
- TinyMCE custom styles remove class when switching styles
- How to use get_template_directory_uri() to load an image that is in a sub-folder of my theme?
- Insert Ad Code in the Middle of a Post
- 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
- Organize functions.php
- How to override functions.php in child theme?
- Overriding core functions in child theme
- Change parent theme file function in child themes functions.php
- Add inline css to theme
- Dequeue Scripts and Style for Mobile not working?
- 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
- Undefined variable error in new function
- How to remove a specific word at the beginning of the content and add it to the end of the content
- 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]
- Getting the teaser text without overriding global variables
- 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
- Best way to disable sidebars on posts (only)?
- Changing where my author box is printed
- Insert Content Before div#main from the functions.php File
- Single.php the_excerpt loads same as the_content not loading read more line
- “options.php” not found
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- Is this an acceptable practice for WordPress theme development?
- What is the correct way to include my new functions and scripts in WordPress?
- wp_nav_menu work in functions.php but not in the theme
- 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]
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- If is_single in functions.php
- I would like single.php to act just like index.php
- Conditional function for excluding first image from content, not working
- Woocommerce Variable Product Dropdown for Custom Shop Template
- How to fix Function create_function() is deprecated in / themes
- Exclude specific post from query
- Advanced method to control cache of enqueued style/script
- WordPress wp_dequeue_script remove all other scripts
- 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
- Why does echo on functions.php not yield result in source code?
- Strip all HTML tags from product content and resave
- 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?
- How to retrieve image IDs from shortcode content?
- $content is empty while using DOMDocument
- HowTo: Add wrapper to columns shortcode?
- How to create admin ajax function for my contact form
- Class::$template_dir_path=get_template_directory();
- How to disable site title and description when custom header is uploaded on the customizer?
- Shortcode to eliminate and replace with
- wordpress not calling peliegro functions.php?
- Language switcher for subdomains
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- Function the_content
- Load a Child Theme’s style.css just before the closing tag
- wp_nav_walker that interacts with widgets to setup mega menu
- Move captions under gallery images in twenty fourteen theme
- 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?
- Add custom css to theme
- 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
- Why don’t ‘wp_nav_menu’ CSS classes work until a menu is created?
- How to get postId from the argument $block when register_block_type()?
- WordPress is adding pagination for all pages not only for blog page, How to remove pagination for all pages except blog/posts page?
- Setcookie not setting cookies anywhere except admin