When it comes to Search Engine Optimization (SEO) you will find numerous tips & tricks on how to increase your page ranking. When it is all said and done the most important thing you can do is write unique and informative content. Regardless of the Keyword Stuffing or shear number of articles, the best way to get search traffic to your site is to write an article/post that is purposeful and informative to it’s target audience. To help get you on your way to increasing your own page rank below are some tips on writing a good article.

1: Write with a Purpose

When writing you need to have a reason for doing so. Don’t simply feel you need you need to write an article every day or on a regular schedule. Only write an article when you have a specific information you want to get across. For example lets say you just learned ruby and have decided to write an article on it. To make a good article or set of articles decide what about ruby you want to write on. Do you want to write a beginner’s guide to using ruby? Is it a comparison of ruby vs php or another programming language? If you write your article for a specific purpose there is a greater change of someone reading the article as well as it benefiting, or answering their questions.

2: Write for your target Audience

Knowing your audience helps to define the contents of your article. If you are writing a topic for individuals knowledgeable on the subject vs beginners then your content is going to be different. For example a How to article for beginners may need additional details on each step including references to special techniques while an advanced article can be slimmer with point by point instructions that gloss over the explanations of how and why.

3: Don’t be afraid to get personal or be opinionated

This is your article, yes you are trying to get a point across but never the less it is yours. Include your own opinions say if you agree or disagree with a subject. The one caveat is to remain on task, don’t go rambling on for 2 paragraphs on a side topic that doesn’t match the purpose of your writing.

4: Keep your writing organized and easy to read

No mater how good the information is in your writing if the reader can’t follow it or understand it then it is bad. Keep your writing organized by each topic smoothly transitioning into the next. Also keep your language appropriate to the target audience so they can follow along with out having to look up words or wonder what you are trying to say.

5: Titles are important

The title of an article is supposed to give the reader an overall glimpse of what they can find or will learn in the article. Be sure to keep them brief but also informative. Some writers find it easier to write the title after an article, while some find it is easier to write it first then jump into the article. Whichever works for you just remember that article and page titles are used in calculating your page rank and also are viewable to searchers on Search Engines.

6: Understanding how to use Keywords

Keywords are an important part of any article, by including them in your writing you are helping to associate your article to specific searches. However this does not mean you need to force keywords into your article. After you write your first draft simply review and you should find that main keywords already are present simply revise and add in any others when they are appropriate and flow seamlessly within your article. If your keywords don’t seem to fit then leave them out or add them into the keywords META tag.

Wrapping it all up

The most important rule to increasing your page rank is to write good informative content for your website. Don’t be fooled into thinking that SEO techniques will push your site’s traffic to number 1 in its category. Instead focus on writing purposeful content for your audience and the rest will take care of itself.

, , , ,

Have you ever stumbled across a project and just think to yourself why does this class exist, or more specifically why did they use this design pattern? Recently I happened across one of those projects, in it the project used a Factory class that’s purpose was to instantiate and return a single class. In essence the developers knew what the Factory pattern was and utilized it without having any purpose to do so. Instead they created additional worthless code. This use of a programming pattern without the need of the pattern is known as Cargo Cult Programming

Cargo Cult Programming

The Cargo Cult Programming anti-pattern is the use of patterns, structures, or code in a project because you either always do or simply because you don’t know what it is doing but are copying it from another project or programmer. This style of programming causes unnecessary abstraction, code bloat and increases the difficulty of maintaining the project over its life span.

Want to be a better programmer? Then understand your code, don’t blindly copy/paste or use a pattern just because you can. Take your time and think is this needed, does it provide a useful functionality or enhancement to my project? or does it simply add additional code and size to the project. Don’t fall pray to becoming a Cargo Cult Programmer

Resources

, , , ,

For some reason I have the utmost trouble remembering how to do a single line or inline if else statement. This article is mainly for myself so hopefully I will remember the next time I want to do an inline if else statement.

The usual format for performing an if else statement is:

if( $val1 > $val2 ) {
    // code executed if true
} else {
    // code executed if false
}

If you are trying to set a variable to a value depending on a condition then it is often the case that an inline if else statement will be sufficient and easier to read. This is done by the use of ?. The full format is (condition) ? (true output) : (false output) or as an example:

$val = ($var1 > $var2) ? $var1 : $var2;
, , , , ,

WordPress has many nice built in features and helper functions for us to use in our websites. Some of the basic conditional functions like is_page, is_single, and is_home are perhaps the most versatile and useful to developers and site owners. These functions simply return true or false for if you are on a page, post, or the home page respectively. However they allow you to easily define custom sidebars and content blocks depending on where the user is on your site.

A basic example would be that you have decided that on your home page you would like to display a random post to the user. However when the user is looking at a post you want to display a post in the same category of the post being viewed. To accomplish this you can utilize the conditional tags is_single, and is_home. The logic shown below simply tests if the current page being displayed is the home page if so it outputs a random post, otherwise if it is a single page (post) it outputs a post from the same category of the current post being viewed.

<?php
// check if on home page
if (is_home()) {
    $rand_posts = get_posts('numberposts=1&orderby=rand');
     foreach( $rand_posts as $rpost ) :
?>
 
        <div>
            <h3 ><a href="<?php echo get_permalink( $rpost->ID ); ?>" target="_self"><?php echo get_title($rpost->ID); ?></a></h3>
            <div><?php echo get_post_meta($rpost->ID, 'teaser', true); ?></a></div>
            <a href="<?php echo get_permalink( $rpost->ID ); ?>" target="_self">Learn More Now &raquo;</a> 
	</div>
 
<?php	
    endforeach;
// test for single post
} else if (is_single()) {
 
     // get post categories
    $categories = get_the_category();
    $cats = array();
    foreach( $categories as $category ) {
             $cats[] = $category->cat_ID
    }
 
     $rand_posts = get_posts(array( 'numberposts' => 1, 'orderby' => 'rand', 'category__in' => $cats, 'exclude' => $post->ID) );
     foreach( $rand_posts as $rpost ) :
 
 
?>
 
        <div>
            <h3 ><a href="<?php echo get_permalink( $rpost->ID ); ?>" target="_self"><?php echo get_title($rpost->ID); ?></a></h3>
            <div><?php echo get_post_meta($rpost->ID, 'teaser', true); ?></a></div>
            <a href="<?php echo get_permalink( $rpost->ID ); ?>" target="_self">Learn More Now &raquo;</a> 
	</div>
 
<?php	
    endforeach;
} 
?>

This is one example of how you can utilize these tags. You could use them to determine if ads should be shown or which ones, changing layouts, or any number of ways.

Resources

, , , , , , ,

When writing a post to your WordPress powered blog or website have you ever wished you could split it up into multiple pages? The good news is that you can WordPress comes by default with the ability to create paginated posts by use of the Page-Link tag. This tag notifies WordPress that the following content should be on different page then the proceeding content.

The tag is used by simply inserting the text <!–nextpage–> into your post. There used to be a button to make this task easier on the user but it was removed to clean up the tools bar. You may find that this tag is not working for you in your site, the reason for this is that the theme you are using failed to implement the Page-Link function into their templates to display the pages. You can correct this by calling the wp_link_pages function in your single post template.

<?php wp_link_pages(); ?>

You can fully customize the page link by the usage of various parameters including before, after, next_or_number, and other self explanatory options. For a full list of options check out the Styling Page-Links page of the WordPress Codex.

, , , , , ,