I did a couple of things to fix this issue…
- I added a function that adds a class to my Vimeo iFrame:
https://wp-time.com/add-custom-class-to-wordpress-iframe-video/
function video_class($html) {
if (preg_match('/(vimeo.com)/', $html)) {
return str_replace('<iframe', '<iframe class="video"', $html);
} else {
return $html;
}
}
add_filter('embed_oembed_html', 'video_class', 99, 4);
- I implemented some JS to change the properties of the embed:
https://jsfiddle.net/tfj8pow9/
$(document).ready(function() {
$('.video').each(function(index) {
var new_src = $(this).prop('src') + '&color=f1d925';
$(this).prop('src', new_src)
});
});
That’s it! Now everything is working as expected 🙂
Thanks,
Josh
Related Posts:
- remove links from images using functions.php
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- Show Video in Excerpt
- Change Rating range in Link Manager
- How to automatically remove links from WordPress Biographical Info?
- How can I modify all existing tags while keeping the urls themselves?
- Add dynamic links in WordPress custom theme
- oEmbed not working in WordPress
- Can’t filter wp_get_attachment_link
- Get arguments from URL
- javascript and css links not working on sever
- Using Static HTML instead of the `home_url()` WP function
- How to convert raw url to hyperlink?
- Best practice to call a function from a button-link?
- Auto Resize embedded videos player
- How Can I Concatenate A String With One Of My Custom Field Value Before Saving The Post?
- Changing author links on homepage to buddypress profiles – without affecting ability to link to author archive throughout the site
- Disable links to images only if link is an image
- How to Add A Rel Filter to All Links?
- Add gallery id to rel attribe of wp_get_attachment_link
- Force resize for all video content
- How can I append and prepend something to all post hyperlinks without using ::before or ::after? PHP hook solution?
- Is it ok to use a function to output the text domain name in a wordpress theme
- How to override a function when isn’t at functions.php
- contactform7 remove tags with “wpcf7_autop false” from functions.php
- How to count number of functions attached to an action hook?
- Show modified time if post is actually modified
- ajax live search for post title
- How to get an array of menu items from the toolbar?
- Using get_terms for custom taxonomy in functions.php
- Fatal error: Call to undefined function add_action() – an untouched problem
- Editing or filtering the output of the Genesis navigation
- Automatically Add Specified Value to Attachment Metadata upon Upload
- Twenty Eleven Child theme error when attempting to use a rewritten function
- is_plugin_active() not properly returning true
- Display gallery on top before content
- List of Body Classes Generated by body_class()
- is_dynamic_sidebar always returns true while using Jetpack visibility
- Redirect specific page in WordPress for first time visit
- qTranslate in functions.php
- Using Schema with `the_excerpt`
- Image rotation fails to regenerate custom sized thumbnail
- Display alert on successful user Sign Up
- Getting different functions data while using while loop in wordpress
- How to rewrite the custom url in wordpress?
- Set spesific size of featured images
- Excerpts are not displayed by a shortcode on category pages
- Getting comment count per post not working
- Functions.php Problem
- It does not work concatenation in function.php
- Retrieve a value from Yoast SEO to use to set a default twitter card image honoring overrides
- Adding javascript to functions.php causes problems with my template
- Where do I store custom functions that call custom page template files?
- Excerpt for pages not showing
- Can’t Write Custom Widget Code In One ECHO
- Got white blank page after copying the functions.php to child theme
- How to Extend login session times to a Month
- Insert nofollow in a “Powered By” link, except in the homepage [closed]
- Image loading function not working on archive.php template
- How to add array [closed]
- what is best way to keep track of changes made in wordpress website? [closed]
- remove_action not working, even after changing priority [duplicate]
- Is this an acceptable practice for WordPress theme development?
- Add a class to post if it has been recently updated
- Change custom featured image size in twentythirteen child theme
- Theme Customizer – Custom Sections Display, but do Nothing
- how to add_filter to non hook function
- WordPress comment processing . Default unapproved comments detection before posting
- Custom image sizes showing in Classic Editor only when upladed directly to post
- Members only function, but allow account activation [solved]
- Remove nofollow from internal comment links via functions.php
- Allow logged in user to view a Page, else send to login screen and then redirect back to Page
- How can I automatically delete comments that contain a URL?
- Run function for specific user only
- Appending „read more” to the excerpt conditionally
- Why is the term of my current page not returning a slug?
- Conditionally apply css for a specific template part
- Serving cache from multiple domain names
- Fatal error: Call to undefined function. Underscore me
- Why am I losing image quality on my site?
- Replace image attributes for lazyload plugin on image elements with specific class
- How to disable site title and description when custom header is uploaded on the customizer?
- How to run a function when publish posts? [duplicate]
- What is wrong with functions.php? Fills error log with same error
- Function returning queried meta value based on current post ID
- Adding custom field in menu options [duplicate]
- Random text changing to weird icons in both admin & front end
- How to add a piece of code in function
- Automatically delete posts based on query
- Pass jquery var to a function in functions.php
- Dynamically adding Captions to images
- How about many “require_once” will affect the page load speed? [closed]
- Run function from parent on child site
- Search Woocommerce product titles only
- Post variables not displaying correctly in custom function
- How can I customize the size of the header of my theme?
- Removing all Category pages with one exception
- Add a second stock display [closed]
- How to fix enqueue_styles error for a twenty-seventeen childtheme
- sort by date in users