[WordPress] Plugin: WordPress Gallery Hack

I rarely use the built in WordPress gallery feature, but having started a family blog with my wife, I found that it is more likely that I will use it in the future.

Only problem? No way to distinguish between images I have in the gallery and ones I want separate.

While researching my next move, I found that this was a known issue with WordPress and has yet to be addressed. Until that day, however, there is WordPress Gallery Hack. It’s not in the codex, so don’t try looking there.

This plugin adds a little link withing each gallery image that allows you to remove it from the gallery. It will still show up when you edit the gallery, but it will not be displayed in your post or page. This can be confusing when you first try it out, but once you get it, it’s worth it.

Now I don’t always use galleries, but when I do, I use Wordpress Gallery Hack

Posted in Plugins, Wordpress | Leave a comment

[WordPress] Plugin: Admin Login As Different User

When I have to debug a plugin, it sometimes requires that I use different accounts to make sure everything is working. This also means that in the live setting, if a user has an issue that I can’t replicate, I have to login under there account. So how do I do that without changing their password each time? With a plugin!

I found Admin Login As Different User while searching through Google for a plugin to do exactly what the title implies. It’s so simple to use that I’m not sure I need to explain.

Install and activate the plugin, go to the plugin page under tools, and pick who you want to login as. Simple as that.

The plugin has saved me a lot of time and headaches since it’s an instant switch over to their profile. I think the only thing that I would change is to provide a link to switch back to your original account.

Small gripes aside, this is a wonderful plugin that any admin should seriously consider adding to their arsenal.

Posted in Code | Leave a comment

[Intro] Intro to HTML: How to build your first page

So now that we’ve been introduced to what HTML is, we can begin to create our first page!

First thing first. Create a new file ending with .html or .htm and save it. This will be the starting file for all your learning. Once you have the file, open it in your notepad or another editor-of choiceand we can begin.

Every HTML page has a very basic layout that is necessary to properly render your content. Knowing how to form the page will affect everything.

Where to start?

To start, you need to choose your doctype. Do you want frames? No frames? Strict rules or relaxed rules? These are things you need to think about when choosing your doctype.

The doctype you pick will determine how the browser interacts with your HTML, and how it displays it. You can review the different kinds of doctypes over at w3schools.com.

For the beginner, I would recommend using XHTML 1.0 Transitional doctype. I recommend this because it will help ease the transition to CSS later on as some browsers don’t like to use HTML 4.01 with css properly (I’m looking at you, IE).

So open up your file and enter this on the first line:

1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Building the basic structure

So you have your doctype. Now what? Why we build, of course!

Every HTML page, regardless of doctype has to have three tags: html, body, and head. While some people will tell you that you can, and that’s correct, it is never a good idea to leave them out, and that may mess up things down the road.

Ok, we have the three tags. How do we make them work? Very simple. Start off by entering both the opening and closing html tags. Put them right after the doctype.

1
2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
</html>

After this, you want to add your body and head tags. The head tag gives the browser information about your webpage itself and the body tag provides the actual content. The go inside your html tags, so it looks something like this:

1
2
3
4
5
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head></head>
    <body></body>
</html>

You will always have at least this much in every HTML file you ever make. Ever.

Ok, so I have my structure, but how do I display stuff?

With the basic structure out of the way, we can get into making your web page display some content. Let’s give the page a title so that when you look at the browser window title bar it will tell you what it says.

To do this, we use the title tag. The title tag is added inside of the head tag. Once there, you can put whatever text you want in there, and it will show up in the browser’s title bar.

1
2
3
4
5
6
7
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>My Title</title>
    </head>
    <body></body>
</html>

Save the file and open it in a browser and you should be able to see your title!

Now for the content. It’s very simple. All the content goes between the body tags.

1
2
3
4
5
6
7
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>My Title</title>
    </head>
    <body>Hello World!</body>
</html>

That’s all you have to do! Now you can start entering all the tags and content you want!

In Closing…

Having covered the very basic beginning structure of our HTML page, we are now ready to move onto the next part of creating our web page, which will be adding more tags to the mix!  It’s about to get real. Does anyone say that anymore?

As with the last post, if you find there is anything missing or inaccurate, then please let me know in the comments!

Posted in Code, How To, HTML, HTML, Informative, Intro Series | Leave a comment

[WordPress] Plugin: Simple Modal

I have just created my first publicly available WordPress plugin. I call it Simple Modal.

I had looked for a plugin that would provide me with a simple shortcode I could use to implement a straight forward modal dialog box, and when I couldn’t find on that met my needs, I made my own.

Check out the project page for more details.

Posted in Code, Plugins, Projects, Simple Modal, Wordpress | Leave a comment

[Intro] Intro to HTML: what is it?

You have reached a point in your life where one of two things has happened. You either are curious about how to edit HTML or you are required to edit it because of work or school.

Have no fear. I am starting a series dedicated to covering the basic ins and outs of web programming, starting with HTML!

Let’s dive right in.

What HTML is

If you have ever done a “view source” on a webpage, you have probably seen something like this:

It is also possible that viewing that code made your head explode.

After piecing your head back together, you can start dissecting the structure and you may begin to see that the text follows a pattern.

Image by chriki7274HTML is a language of tags that are nested within one another. To help you visualize, it’s kind of like those Russian dolls. The top to each doll is an open tag and the bottom is a closing tag. If you open up a doll, you find more dolls (tags).

With HTML, however, you can nest more than just one tag at a time. You can nest as many as you’d like.

What HTML isn’t

HTML is sometimes referred to as a programming language. This is an incorrect statement. HTML is actually a markup language. In fact, it stands for Hyper Text Markup Language.

Markup languages are more for storing simple data and formatting rules whereas a programming language is used to execute commands and manipulate data. In the case of HTML, the language is used to tell a web browser how to display the content.

How HTML works

As I said, HTML tells the browser how to display content.  This is done by the different types of tags and their placement on a page.

HTML is read from the top down and, as such, content is typically rendered using the top down. So if you have an image tag before a paragraph tag in your code, the image will render before the paragraph. Alternatively, if you were to move that image tag after the paragraph, it would show up after the paragraph on the rendered page.

Along with the placement, tags have attributes that you can use to manipulate how things are rendered. Tags largely control placement and browser interpretation and attributes control the look and feel of a tag.

Tags

As I previously stated, tags are used to nest and display objects as well as place them on the page, but what exactly is a tag?

A tag is a piece of the markup language that dictates browser behavior. For instance, a “p” tag indicates you would like to use a paragraph, and an “img” or image tag indicates that you would like to display an image on your web page.

All tags are encased inbetween the greater-than(>) and less-than(<) symbols. If the browser ever sees a raw greater-than or less-than symbol, it automatically assumes it’s a tag.

Every tag has an open and closed version, though some are combined. What this means is that some tags allow additional content to be nested within, but not all tags nest. To use our earlier example, the “p” tag allows content to be embedded within it where the “img” tag does not. These are written differently:

1
2
3
4
5
6
Because the p tag has opening and closing tags, you can put stuff in it!

This is my content

Image tags can't do that since they self close with a slash
<img src="cat_pic.jpg" alt="" />

Notice the p tag has opening and closing tags while the image tag ends with a slash. The image tag is what is known as a self-closing tags. While any tag could potentially be a self closing tag, I have yet to find a reason to use a self closing tag beyond the “img”, “br”, “link”, “input”, and “hr” tags. I know there are more self closing tags, but those 5 are the most common.

Attributes

If you look closely at the image tag in the example I laid out above, you will see an attribute at work. The image tag uses the “src” attribute to tell the browser where to find the image that you want to display. So when you have <img src=”cat_pic.jpg” />, the browser looks for cat_pic.jpg in the same folder as your html file.

All tags have some attributes, the most useful of which is the style attribute, which I will cover in a later post. These attributes help to modify how the tag looks and acts.

Attributes are always included as part of the tag and are found between the greater-than and less-than symbols. You assign values to each attribute by saying the attribute = “something”. The values must always be contained in either single or double quotes.

In Closing…

That is HTML in a nutshell. In the next installments I plan to cover actual HTML code. Further past that I plan on introducing CSS, HTML5 and Javascript. Should be a good ride for all you newbies out there. For all your code masters, correct anything I say that may be wrong. I’d rather have this accurate than having too much pride to admit I’m wrong.

Posted in Code, HTML, Informative, Intro Series | Leave a comment