Use Bootswatch themes with Museum Core to “skin” your site

I did a writeup on Museum Themes on how to use Bootstrap 3 themes with Museum Core (which this site uses) to get new “skins” for the Core theme. Note: I wouldn’t have even thought of this if it wasn’t for Shawn Wildermuth‘s Bootstrap 3 course on Pluralsight. If you want to check it out, I still have some trial codes to give away over here.

Use Bootswatch themes with Museum Core to “skin” your site – Museum Themes

Brought to you by Sublpress

This post is being written in Sublime Text thanks to a new package by Nicolas Dienstbier — who has a much cooler way of shortening his name than I do (what could I do? rnlds? Actually…) — called Sublpress. The premise of Sublpress is simple — use Sublime to manage your WordPress site(s). You can do just about anything you could do logging into your site and you can manage multiple sites. But, of course, the most obvious thing you’d want to use it for is posts, right? I mean, that and never having to leave your IDE which is pretty cool, too.

Sublpress uses the command palette for everything. Thanks to a recent update, once I’m connected, I can go straight to new post. And so it is that I am typing this in Sublime and not the WordPress dashboard.

Since working with Dropplets, I like using a simple text editor (okay, maybe not a simple text editor — but rather one that has extra capabilities to handle formatting and displaying text) to write posts. And while I’d probably prefer composing this post in markdown, and uploading someplace automagically (via drag and drop or some kind of autonomous synchronization), using Sublime is pretty nifty, too, and it may turn out to be my preferred method of posting.

I will say that I have a couple pet peeves about Sublpress. One is inherent in the framework and that’s the lag for connecting to your site to do certain actions. Originally (before I raised the issue on GitHub), you had to go into the Manage Posts screen before you could create a new post. I have thousands of posts, and this made Sublpress just crap out before it ever got to that screen, so I asked for it to be moved to a higher-level screen so you wouldn’t need to go in there. But there are similar issues with selecting categories or tags — it has to load all of the categories or tags before you can assign them to the post. And as of this writing, I have to go to Manage Taxonomies → post_tag to create a new tag and then go into Post Actions → Modify Terms and Taxes → post_tag to assign that new tag to the post, rather than just being able to add a list of comma-separated tags the way I can in the WordPress Edit Post screen, creating new tags on the fly if they don’t already exist, all the while waiting for Sublpress to connect to the site and query for that information (on the flipside, though, I don’t need to wait once I’ve told it to do something, e.g. I’m typing this now as I’m waiting for my tags to pop up). You can’t set a featured image for a post and — considering you need to connect to the server (and wait for it to respond) just to pull up a list of the available post statuses — it’s not very reasonable for actually publishing posts. But it’s still under development and there’s lots of room for improvement and growth.

In-Place Windows 7 RC downgrade to Windows 7 Home Premium

a few months ago, i posted a link to a hack that revealed how to do an in-place “upgrade” (although it’s really a downgrade) from Windows 7 RC-1 to a lesser version of Windows 7.  as the nag alerts saying i need to backup my stuff and reinstall have started cropping up, i decided to finally put the copies of Windows 7 i actually purchased to use.  but i knew i was going to be in for some issues.

click here to skip the narrative and go straight to the fix.

see, what i did — which made perfect sense at the time — was i took advantage of the limited-time, special pre-order discounts that were available towards the end of the official testing period, grabbing two copies of Windows 7 Home Premium upgrade for $50 each.  i figured, someone, somewhere, would figure out how to hack them to just do an upgrade from the RC.  they figured out how to hack the beta to the RC when you weren’t supposed to be able to do that…

the problem of course (which didn’t apply to the beta → RC upgrade), is that Home Premium is a different version of Windows than RC, which uses Ultimate.  and therein lies the issue — an issue i realized would be a problem when i tried the upgrade sometime in december (before i found the hack) and it was giving me this message:

when i went to do the upgrade using the method i linked to after christmas, i still got the same message.  i didn’t get it.  yes, the hack was a pretty stupid hack, just changing a couple registry values from “Ultimate” to whatever version of Windows was less than what you were trying to install, but still, supposedly people had done it with success.

it wasn’t until i found this hack — which is based on that one — that i was able to figure out a way to get it to work.

so the original hack goes like this: open regedit, and go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion and change the values for EditionID and ProductName.  The assumption is that you could change them to whatever you want, just name it the name of the operating system.  so you’d go from “Ultimate” to “Home Premium.”  the problem, of course, is that this didn’t work.  and from what i could tell in the comments for that post, it didn’t work for a lot of other people trying to downgrade to home premium.

the difference in this other hack i found, first of all, is in how the edition is named — e.g. it’s important that you use the exact name that the edition identifies itself as on the DVD, which he displays in a graphic:

so, that helped, but it still didn’t work.  i used “HOMEBASIC” and “Windows 7 HOMEBASIC” in the correct keys and still got the same message saying i can’t upgrade from Ultimate to Home Premium.

really, Microsoft?  i finally decide to spend money on your operating system and — because of a loophole in your installation process — you’re still going to try to either suck even more money out of me or force me to find a pirated copy anyway?  i started warming up my demonoid searches…

but then i notice that the post indicates that the registry values you enter need to match the version you are installing.  but that can’t be right…surely changing the values from “Ultimate” to “HOMEPREMIUM’ aren’t going to work on a Home Premium install, are they?  it works like the cversion.ini hack used to upgrade from beta to RC — you just need to make it something less than the current version…

i tried it and, whadayaknow, i saw a new screen:

so i knew i was in pretty good shape when i saw the installation actually start working.  i was a little nervous, however, when the install hung at 20% on “Gathering files, settings, and programs”.  i stopped and restarted it when i didn’t see it changing at all, and it hung again at 20%.  this time i left it alone and went away from the computer.  a while later i came back and saw it had moved to 88%, and it was fine from there.

note:  i will say that at some point the computer rebooted and brought up a screen about how the repair wizard couldn’t fix the startup error.  i closed that screen, the pc shut down, but then started windows for the first time fine after that.  it’s been working with no issues since, so i’m calling it a fluke for now.

after that, it booted up fine and asked for my product id (which, of course, i have), and has been working like a charm ever since with a retail version of windows 7 home premium.

so, once again, here’s how to downgrade from Windows 7 RC-1 (Ultimate) to Windows 7 Home Premium
(note:  presumably this would work with other versions but as i have not tested it on any other version, I can’t vouch for it personally, although the original post i used as reference indicated it would work for Home Professional as well)

1 – open the registry editor by going to Start > Run > regedit

2 – navigate to HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ WindowsNT \ CurrentVersion

3 – double click EditionID to open it and change the value from “Ultimate” to “HOMEPREMIUM”

4 – double click ProductName to open it and change the value from “Windows 7 Ultimate” to “Windows 7 HOMEPREMIUM”

you’re done.  it works without a reboot.  you should be able to just start your installation.

also note: this is still using the method that changes the cversion.ini file on the DVD image, so you’ll still need to do that first.

okay, ready, break. you’ve got about 9 days left before your computer starts shutting down.  if you waited this long to install the retail version, wait no longer, do it now.

wordpress shortcodes kick ass (or: shortcodes, an affiliate marketer’s best friend)

shortcodethis one will make the internet marketing peeps smile…

let’s say you have some kind of text or phrase that you use a lot.  it could be anything, but let’s — for the sake of argument, and for showing the full power of this code — assume that the text or phrase includes a link.  let’s go one step further (for the aforementioned affiliate/internet marketers) and say the link is big, long, ugly, and not something that you have memorized like you might a regular url like www.arcanepalette.com.  no, this link is something like http://paybymailandstuff.com/123468752/?id=sooperdooperaffiliate.  that’s not so easy to remember unless you have it saved somewhere and can copy and paste.  which requires you to find it, copy it, and paste it in.  this is where the announcer guy overdubs the flabbergasted and frustrated housewife saying “there has to be a better way!”

THERE IS!

WordPress shortcodes take one block of text and replace it with another.  Possibly you’ve used a plugin that relies on shortcodes…some examples i can think of off the top of my head — because i use them on jazzsequence.com — are the flash audio player plugin and download counter. in both cases i need to put some kind of predefined text in brackets along with something that makes it unique to what i’m trying to embed.  so as i’m writing the post it looks something like [functionname(uniqueidentifier)] or [functionname:uniqueidentifier] — in the case of the audio plugin, for example, the specific usage is [au.dio:audiofile.mp3] and for download counter it’s [downlo.adcounter('downloadname')].  those are shortcodes — it takes one thing that you type into your post, and turns it into something else behind the scenes.  now, let’s go back to our ugly example…

i’ve got the ugly link and i want to link it to the phrase “my fancy product”.  every time.  sure, i could type “my fancy product” as i’m writing the post, highlight the phrase, click the link icon in the visual editor, flip back to my notepad document (or whatever) where i saved the link, copy it, paste it into the link box in WordPress, and then select “open in a new window” (or not, depending on if i want to lure them away from my site…) and hit OK.  i could even save the full link in a notepad document, so i’d have [co]<a href=”http://paybymailandstuff.com/123468752/?id=sooperdooperaffiliate” target=”_blank”>my fancy product</a>[de], and then i would switch over to the HTML editor in WordPress, paste in the full link code, and then switch back to the visual editor and finish my post.  i could do that…but all those extra clicks and switching apps and windows are time consuming, especially if i need to do this multiple times in a post or a page.

that’s where shortcodes come in.  for the same link, i could add this to my [co]functions.php[de] file:

[co]function fancyproduct() {
return ‘<a href=”http://paybymailandstuff.com/123468752/?id=sooperdooperaffiliate” target=”_blank”>my fancy product</a>’;
}
add_shortcode(‘link’, ‘fancyproduct’);[de]

now i can just type [link] while i’m posting, and when the post is published, it replaces that with a link to “my fancy product”.  i’m using this right now to be able to type [a.p] to insert a link back to my business’ website, [ap].  and i’m using it in this post to open and close [co]<code>[de] tags, rather than doing it manually in the HTML editor.  really, the number of uses for this are only limited by the number of things you do.  you can use shortcodes to insert images, text, more code, whatever.  the important thing to remember when you’re doing this on your own is how to set it up right.  so:

[co]1 function fancyproduct(){[de] — that’s the name of your function.  it can be anything but something identifiable makes it easier to recognize later.
[co]2 return ‘[de]this is where you put whatever you want the output to be[co]’;
3 }[de] — this closes the bracket that was opened on line 1 that tells WordPress what to output for the [co]fancyproduct[de] function.
[co]4 add_shortcode(‘[de]this is what you want your shortcode text to be. just remember you don’t need the [ ] brackets here, only when you are actually writing the post[co]’,'[de]this is the name of the function from line 1.  this is important because it sort of makes the whole thing work[co]’);[de]

but how do i edit my [co]functions.php[de] file?

glad you asked.  if you aren’t a hacker like me and already savvy with DreamWeaver or some other HTML editor, Automattic conveniently gave you a text editor right in your WordPress backend.  (if you are a geek, just open the functions.php file in your theme files in your favorite text or HTML editor.)  to get to the built-in theme editor, expand the Appearance tab and click Editor (there’s also a Plugin Editor, too, so make sure you click the Editor link under Appearance).  from the list at the right, click on Theme Functions (functions.php).  now you’re in.

php code can be scary even to someone who’s familiar with HTML.  the [co]<?php /*some code here */ ?>[de] tags are intimidating, and make everything look a lot more like programming.  it’s not.  you just want to add in your shortcode block before the end of a [co]?>[de] bracket, or wrap the whole function in php tags like this:

[co]<?php
function fancyproduct() {
return ‘<a href=”http://paybymailandstuff.com/123468752/?id=sooperdooperaffiliate” target=”_blank”>my fancy product</a>’;
}
add_shortcode(‘link’, ‘fancyproduct’);
?>[de]

and i like to put comments in there so i know what i’m doing.  there’s two ways to comment things in php, you can either use [co]//[de] which you would do if your comment ends at the end of the line or [co]/* some stuff here */[de] for longer comments that can span more than one line.  my final [ap] shortcode function looks like this:

[co]// arcane palette shortcode
function apalette() {
return ‘<a href=”http://www.arcanepalette.com” target=”_blank”>Arcane Palette</a>’;
}
add_shortcode(‘ap’, ‘apalette’);[de]

this trick came from WPShout, where its author, Alex Denning, always posts awesome tips, tricks, and hacks for WordPress.  you can take a look at his post Write Faster with WordPress Shortcodes for another explanation of how they work.