Tutorials

The tutorial section consist of … Tutorials. Yay! Anything I add that can be used for some form of learning will be add to this section. Include but not limited to Web, Graphic, Digital Photography, Audio, Video, etc. If one of the tutorials helps you and you end out using it some how please comment the post so I can feel all warm and fuzzy inside. Thanks.




Test if WordPress Category Exists

Wednesday, August 26th, 20092009-08-26T16:00:15Zl, F jS, Y

If your moving content around quickly on your WordPress or if your designing a template with no content to fill it, then your going to run in blank query results, Sorry, but you are looking for something that isn’t here. – WordPress default phrase. Now if you don’t have any posts at all then having a default phase is need but if there are posts in your blog and you only want to display a specific category independent from the main loop and the category is doesn’t have any posts then the there is no need to show the box at all. Now I do realized that if the you add a loop to your template then you know it’s there and you’ll make sure there is content to fill it. That being said there is only really two (maybe more) times in which you may want not to show a section if a post category doesn’t exist and/or hasn’t any posts. First is WordPress MU in which a new blog won’t have the category set up and will certainly not have any posts in it. Second when your creating themes for WordPress.org’s Theme Directory or resale and you want to add special features and display methods.

Continue Reading »




Limit Characters in a PHP String

Tuesday, August 25th, 20092009-08-25T18:02:39Zl, F jS, Y

Recently I working on a little pet project of mind in which the content will not be created by me however will be generated by my logged in users. The problem with letting other people into the website and have control over it is that as a coder I need to add in fail safes, and make ever step idiot proof. In this case I need to make sure that the user doesn’t create an epic saga of text and post it on the main page. Like most of my projects, it uses the WordPress engine to allow the users to enter in their data. WordPress has a two built in methods to decrease the output of text to a more manageable size.

Continue Reading »




PHP Include

Thursday, May 7th, 20092009-05-07T20:45:30Zl, F jS, Y

Using PHP in the simplest sense is to use includes. Includes call multiple files together to form one static HTML base document. PHP is a server side language and thereby the language is processed prior to leaving the sending the server. So by the time the file gets to your browser it’s already full HTML. When using PHP without a database and just for the includes and mathematical logic the page won’t be fully dynamically created but at lest it will decease reputation in the documents.

Continue Reading »




JavaScript Random Sorter

Saturday, April 18th, 20092009-04-18T19:20:51Zl, F jS, Y
<script type="text/javascript">
var contents=new Array('1','2','3','4','5','6', '7', '8', '9', '10');

var i=0

//variable used to contain controlled random number
var random
var spacing="<br>"

//while all of array elements haven't been cycled thru
while (i<contents.length) {

//generate random num between 0 and arraylength-1
random=Math.floor(Math.random()*contents.length)

//if element hasn't been marked as "selected"
if (contents[random]!="selected") {
document.write( contents[random] + spacing)

//mark element as selected
contents[random]="selected"
i++
}
}
</script>
Continue Reading »




Javascript Random Value

Thursday, April 16th, 20092009-04-16T20:22:22Zl, F jS, Y
<script type="text/javascript">
KeywordArray = new Array(5); //Create Array with 5 options
KeywordArray[0] = "John";  // Option begin at 0 not 1
KeywordArray[1] = "Matt";
KeywordArray[2] = "Mike";
KeywordArray[3] = "Josh";
KeywordArray[4] = "David";
var randno = Math.floor ( Math.random() * KeywordArray.length ); //call variable from a random number(up to 5)
document.write(KeywordArray[randno]); //render code
</script>
Continue Reading »




CSS Menu Overview (Part 2)

Wednesday, April 1st, 20092009-04-02T04:46:15Zl, F jS, Y

The second version of a CSS menu

Continue Reading »




CSS Menu Overview (Part 1)

Friday, March 27th, 20092009-03-27T18:00:39Zl, F jS, Y

Cascading Style Sheets (CSS) is a style sheet language used to describe the look and formatting of a document written in a markup language, most commonly use in (x)HTML. These menus are based on the <ul> tag (Unordered List) and structure and designed in the CSS. In the CSS you can define what direction to “list” the menu: Horizontal or Vertical. I’ll be covering both in this two part tutorial and will be provide a complete code for both examples.

Continue Reading »