Monthly Archives: November 2011

jQuery getting value of select with mulitple values

I have been dipping into learning jQuery. Very powerful and useful. But as I am just learning it, I am taking a learning curve to figure it out. Today I came across the need to get the values of a select that had multiple values. I needed to take the name attribute from the option as it contained a filename that I was going to use to display the image. Further more I wanted to separate those images based on their dimensions.

After some thankless google searches, I came up with code that accomplishes this task easily.

As for the HTML, I have my select box with multiple=”multiple” in it. Each option has a value attribute that I use for the database and a name attribute containing the filename. They also contain the friendly name. I then have 3 divs setup like so:

The loader lets me simply get the image loading, once it has the height and width of the image it moves it to the correct box. I keep the loader div hidden so there is no moving around showing as it does its work. Does the job for what I need it to do. Which is a simple previewer of the images being selected. I need the bigger ones to be separate as these are usually tower based images and would make a ugly looking layout otherwise.

Read More

WordPress templates on non wordpress pages

I have a couple pages such as my password generate that are non wordpress templates. However I want these to be styled as if they where from my wordpress. So after some google searches, I came up with very little information. I decided to dive into the code and came up with something that works for what I need it to do and requires little code edits to any of my pages to work.

This does also require a template edit to your wordpress templates. Sadly I couldn’t avoid this, I looked around and tried to see if I could modify the_content(), however it doesn’t look very pleasant to do so. I might in the future look into doing this. If somebody has a better solution that requires no wordpress template edits, please let me know. Back on topic, I modified page.php in my template and changed:

To this line:

Next I will just dump a file I named wp-ssi.php and explain how it works at the end.

Now for all my files I add at the very top. Of course, you need to substitute the path to match yours.

As for wp-ssi.php, I will can explain more about how that works.

Read More

New theme

It was time for a new theme. So here it is. A bit modified from the original version I downloaded. Including some css edits and the ability to fully work with mobile devices (I only have a andriod to test though).

Interesting note on the mobile features though, both Android and iOS have a issue where they can’t use the css overflow. iOS at least lets you scroll the content, but none of them will show a scroll bar of some sort.

Read More

Highslide for Wordpress Plugin