Since WordPress 3.3 a nice new drag and drop uploader was included. It works great because it has fallbacks for older browsers that don’t support the newer HTML5 api. Accessing the file uploader still requires bringing up the media uploader via the upload button. Wouldn’t it be even nicer if we could directly drag and …
Access The Main Post ID Anywhere based on the Current WordPress Page
There’s a number of ways to retrieve the post id of a post, but what if your page has multiple loops and you want to retrieve the main post id of the page? In my case I wanted to insert social buttons only on the main content of the page. If you are using the_content …
Loading CSS mid-page, HTML5, WordPress & Passing Validation Part 2
With HTML5 it’s possible to declare CSS stylesheet inside the body tag. This gives WordPress developers a better solution for including CSS on the fly, such as via a shortcode. It instantly makes several workarounds redundant. The native WordPress function wp_enqueue_style can now be called mid-page, which will print a stylesheet in the footer. Two …
Loading Javascript and CSS mid-page, HTML5, WordPress & Passing Validation Part 1
Since WordPress version 3.3 it has been made a lot easier to load javascript and stylesheets mid-page. Why would you want to do this in the first place? Well a lot of plugins load their own CSS and Javascript files on the page and some of them do so at times when it’s not really …
Using CSS3 PIE with WordPress Plugins and Themes
UPDATE: I have posted an updated method for the latest version of PIE (v2) CSS3 PIE is a fantastic tool to achieve support for CSS3 styles in versions of Internet Explorer, such as IE& and IE8. If you have been trying to include PIE with your WordPress project you might have had some problems with …
How to truncate your WordPress RSS Feed at the More Tag
The More tag is a marker you can place in your WordPress posts that breaks up the post into two sections. It’s used to manually determine where the ‘read more’ link is placed when presenting a teaser of a post. WordPress doesn’t respect the More tag in RSS feeds by default, so if your rss …
How To Query Multiple Custom Post Types with query_posts [WordPress Tip]
A very common WordPress function to modify the posts that are fetched on a page is called query_posts(). There are two ways to pass parameters to query_posts; you can pass an array or you can use the concatenated version. To display multiple post types on a page, the easiest way to do that is to …
CSS Transition Problems with Display, Height 100% And Workarounds
CSS transitions are an exciting development in the world of web development, but it’s still a work in progress. I wanted to have a content block appear and hide on a hover event with pure CSS and a nice animation. My first thought was to animate the display property from display: hidden to display: block, …
Showing and Hiding Content By Clicking A Menu Link (jQuery Tutorial)
While working on the user interface of the WordPress Plugin I’m building, I needed to have something akin to a drop down menu. A user clicks on a menu item, and a related list appears elsewhere on the page (in my case it’s a tool menu). To achieve this functionality I first looked at existing …