I was able to find some jQuery that helped solve the issue:
$( ".alignright" ).parent().addClass( "alignright" );
$( ".alignleft" ).parent().addClass( "alignleft" );
$( ".aligncenter" ).parent().addClass( "aligncenter" );
This small piece of code finds alignright
, alignleft
, and aligncenter
then adds those classes to the “parent” container, which is the containing element that those classes are applied to – in my case that would be the “featured” span.
Thanks,
Josh
Related Posts:
- ajax live search for post title
- How can you limit srcset on a single type of page?
- Scripts not appending to element in AJAX call – why?
- Remove after images
- PHP mixed with some JS code to update WordPress theme settings
- echo custom fields with AJAX
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- Creating multiple category drop down
- Automatic add space if user enters number(any digit)
- WordPress Menuing Question :focus
- Can you put a condition on add_image_size() depending on the width of the uploaded image?
- show first 3 thumbnails of posts in different sizes [closed]
- How to change the order of Jquery in the footer of my theme?
- Warning: : DOMDocument::loadHTML(): Empty string supplied as input in functions.php when adding classes to post images
- How to search using ajax for exact phrase or words in an input field?
- how to en-queue jQuery to load before the tag
- Jquery implementation not working on page reload
- Getting custom image size URL in functions
- Set spesific size of featured images
- I can’t enqueue my scripts – They literally aren’t being added to my site
- Attempt to change jQuery version caused White Screen of Death
- Can’t generate thumbnail images
- media resize/crop possibilities?
- Load jquery only for certain pages in the backend
- Add a unique class to HTML tag/element
- Change CSS for logged in users
- Always the Latest google jQuery instead of default WordPress jQuery
- Add a jQuery Function
- jQuery does not work
- using jQuery on only one page
- Make wp_link_pages() suitable for Twitter Bootstrap markup
- Can’t call Javascript function – scope?
- Control the srcset much more (not all sizes in it each time)
- Changing parent element’s class or style
- Way to store featured image width and height in two separate variables?
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- srcset and custom field get_post_meta and wp_get_attachment_url
- Limit dimensions of “Full” size images
- Visual Composer creating own shortcodes with vc_map() to return simple Image
- Adding jQuery datepicker to Custom Post Type Metabox [closed]
- In jquery use php variable to execute an enqueued jquery file
- How to hide image-url if no attachment?
- Run a jquery script on on a certain template page
- Add php code to wp_print_scripts?
- What are the meta fields for an attachment?
- How can i unload effect.min.js file?
- wp_enqueue_script | Help me figure out what is causing jQuery is not defined
- Woocommerce image sizes missing from Appearance › Customize but not declared by theme
- How to properly set custom logo size?
- Add attribute only to first image of every post via functions.php
- The correct way to add a JavaScript in the functions.php [closed]
- Where is this JQuery coming from?
- Need To Change WordPress Meta Tags… Includes wordpress shortcodes
- Need to convert image url to a Base_64 data url with wordpress function..
- How to Add Shortcode to html img code?
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- How to add a new image size and apply it to posts only?
- How to load jQuery in TOP of wp_footer?
- Passing Jquery value to WordPress function
- Function to insert missing image size attributes into img tags
- Image Crop Not Working
- WordPress can’t get jquery/unslider to work
- Add loggedout class on body using a function or JS
- Are innerHTML elements visible to jQuery functions?
- Include Jquery libraries in wordpress theme?
- Use existing image sizes for WooCommerce
- Problem in using Customizer
- wp_get_attachment_image_src returns image on main domain, false on subdomain
- 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]
- Retrieve First Image Function
- get content from page through AJAX
- Custom Image Size in Insert Media
- How to setup a popup registeration page in wordpress with function.php
- Featured Image keeps cropping
- Prevent creating multiple image resizes in twentytwelve template
- Shortcode of a function
- colorbox not loading in
- Conditional function for excluding first image from content, not working
- How to add php within jquery
- Using add_image_size in functions.php to get original uploaded file
- get_image_tag() html output : empty src attribute
- Help with IF has focus then… statment
- Lightbox type effect to support a HTML/jQuery image map
- Need To Resize Images Exactly Without Losing Image Details
- Get URLs for AJAX Filter Checkboxes WordPress
- Custom image sizes showing in Classic Editor only when upladed directly to post
- how can I change all wordpress media file url to custom cdn url?
- Different image using srcset function
- wp_set_object_term via js btn frontend
- Is it possible to limit number of files a non-admin user can upload via the WordPress media library?
- Auto delete content in specific folder inside media library
- How to change images url in function.php?
- How to use data URL in WordPress?
- Populate Product Regular Price with a calculated ACF Field Value
- Hide ‘add to cart’ when certain value in dropdown is selected
- Ajax Form Issues using Lightsail (AWS)
- How to update an image attachment’s alt text from a custom field when saving a post?
- how to check if an element in an html file exists in another html file? [closed]
- What is the earliest Hook a Script can use?
- WordPress does not load jQuery