CSS for Resizing Video
Just a handy chunk of CSS to make your video embeds behave better. It’s out there but not a bad thing to spread farther.
Origin Story We had two sites on a multisite installation. The desire was for site A (or any number of sites) to have posts in a certain category duplicated to site B. In many scenarios we’d just use Feed WordPress but in this case both sites were private. There may be a way to get that working in FeedWordPress but I am not aware of it. These two functions will copy content from one site to another when it is published. It won’t sync up editing or anything like that but it’s a decent start for doing that if it was desired. The explanation is mainly in the code comments. I’m not sure if that’s useful but I also realize that the audience for what I writeExcept for the footnotes. The footnotes have up to 4 people who read them. is mostly me and I’m ok with it. Now you could change add_action( ‘publish_post’, ‘copy_post_replicator’, 10, 2 ); to add_action( ‘update_post’, ‘copy_post_replicator’, 10, 2 ); and it’ll run on any post update. The problem there is that edits to the posts will result in duplicates on the destination site. If we wanted to get fancy, we could record the post ID of the duplicate post as a custom field on the original and do some updating function based on that […]
If you’ve got a site running on HTTPS and you try to throw in some HTTP content, the browser gets nervous. If you’ve recently made a shift to HTTPS you might notice content that was successfully embedded disappearing. If you look in the browser (right click>inspect element in Chrome), you’ll see an error like the one above. What you want in this scenario is protocol relative URLS . . . essentially a URL without the leading http/https. That lets the page load via the one protocol that matches (assuming it exists- some sites won’t supply HTTPS options).Reading more about it, it seems forcing the HTTPS connection where available is encouraged. I’ll think about that more later. I ran into this problem with files we uploaded via Gravity Forms prior to the switch to HTTPS. There are a number of ways to deal with this (including search/replace at the database level) but we’re under a very heavy load at the moment and I just needed a quick fix. This solution will also allow people to do whatever they want on an ongoing basis better than a database response. This tiny little filter plugin is the result. All it does is use PHP’s preg_replace (regex) function to find any instances of HTTP or HTTPS (capital or lowercase) and remove them. I’m still […]
Image from page 981 of “A system of instruction in X-ray methods and medical uses of light, hot-air, vibration and high-frequency currents : a pictorial system of teaching by clinical instruction plates with explanatory text : a series of photographic cli flickr photo by Internet Archive Book Images shared with no copyright restriction (Flickr Commons) This is a bit odd but if you work in education it’s quite possible it’ll come up . . . Sometimes people just want the blog comments in a nice friendly CSV file. That might be for grading, it might be for further analysis in Voyant or something like that. What I need to do is write a little plugin for the export like Alan did for posts but until I get around to that I took advantage of another plugin Alan wrote to expand comments to the 100 most recent comments. So since I have lots of comments available in the feed, I can just use the =IMPORTXML function to port right into Google Sheets. There’s probably a smart way to parse out multiple XML fields at a time but this seems to work ok. All the functions I used are broken down in the sheet embedded below. Most are simply some version of IMPORTXML(b1,”//title”). B1 is the URL for the feed and the […]