How’s that for faster? But the shortcodes can also accept attributes. Here’s a list of the other shortcodes I created, and what they do:
[dmyoutube id align title width]
id
is the YouTube Video’s IDalign
can be either left, right, center, or full and sets the alignment of the videotitle
is the title of the videowidth
(optional) is the width to use for the embedded video; if no width is specified, it will default to 160px; the height will be set to ¾ of this value[dmaudio file title linktext]
file
is the audio file to link totitle
(optional) defaults to "Audio Track" if none is specifiedlinktxt
(optional) defaults to "play the song" if none is specified[dmvideo file align title]
[dmphoto file extension align title caption]
[dmstars 2.5 ratingtype]
So, with so many shortcodes, and so many different attributes, it would be easy to forget how to use them. that’s why I added the quicktags on the post/edit pages for each one. All I have to do is click the respective button and it prompts me for all the necessary attributes. Nice!
Another cool thing is that, not only do the shortcodes make writing faster, but I can embed YouTube videos on my articles and still be XHTML strict compatible. For some of the shortcodes, I am outputting modified HTML content to the RSS feeds so that links aren’t broken, javascript is stripped, video thumbnails can be embedded for YouTube (since objects can’t), etc. They also standardize the way everything looks throughout my blog and I only have to change the code in one place for all articles to be updated with the new code and styles. Awesomeness.
If you want to see some of these features in action, have a look around my blog (you can use the searchbar in the header or use the tags listings on the archives page). I converted all my past articles to use these shortcodes wherever there was audio, video or YouTube embedded before. Also, if you’re interested in seeing any of my code, or want help with any WordPress stuff, please don’t hesitate to contact me.
In terms of the theme, like I said, I wasn’t expecting to create my own theme. But after having such an easy time with my plugin functions, I decided, why not? The only theme I could find that I really liked was WPCandy’s v1 WordPress Theme by Michael Castilla, but after realizing that I would still be spending time to modify it to have it the way I wanted (and to incorporate comment threading), I thought, why not make my own theme? I thought about how to re-design my blog and make it fancy, but in the end, I decided to make it a combination of my dmred.ca and DanielMenjivar.com sites, for simplicity sake. I used the included "default" theme as a starting point, but you could say that my blog’s design is very much inspired by the WPCandy theme – thanks a million Michael!
Lastly, since my blog’s design uses a lot of fixed div
s, I decided to create a separate CSS stylesheet for the iPhone and took the time to do the same for my DanielMenjivar.com site too. (Since most people probably don’t know that you can still scroll through fixed divs on the iPhone by using two fingers instead of one… There’s a tip for you!)
Anyways, it was a much more pleasant experience than I had expected. I really wanted to make sure that I didn’t "hack" things the way I did with my last theme and wanted to make sure I did things the right way this time. Lesson learned. Now I can change my theme and update all my plugins the easy way, (with one click), without having to worry about losing features, custom edits, etc. (I will admit, it was sometimes hard to find documentation for some of WordPress’ functions, but for the most part, things were easy to find and went very smoothly.)
Well, this has been a long article – thanks for reading!