Check out this post for neat online tools to help with design elements when creating web sites.
Wednesday, July 13, 2011
Sunday, June 19, 2011
What Is SEO And What Is Coincidence?
I haven’t posted much lately. Mostly that is down to a new role I have as a Web Developer now. As per usual I am not going to give away the name, but it is a fairly large media company here in NZ. Obviously it is working within their digital department, “digitizing” what they currently have in print.
I have only worked there just over a week, and already I see things that still astonish me about SEO in a real world sense. Generally I like to think that all developers that code for the web should have a good grasp of SEO technologies. And hopefully keep up to date with the changes that search engines implement. It isn’t always the case, but most people atleast have a good understanding of what will and won’t rank.
Interestingly enough I was talking to someone on my team about SEO. His actual job title is “SEO Developer”. As I got talking, I could tell that he seemed to be sticking by the book. And any sort of “contentious” issue that would get debated to no end at a SEO conference was a simply open and close case for him.
Things such as nofollow links and meta tags were an absolute 100% no impact on ranking issue for him. To me, especially nofollow links, I have a believe that they do work. Blog Comments while devalued, still seem to give me some sort of boost in the rankings. Whether that is because of the rank, or just because my website is “out there” is something that I could argue all day long. We talked about it for a while, and all I tried to get across was that nothing in SEO is a yes or no answer. Everything is shrouded in mystery and it is only with testing for yourself can you see what works and what doesn’t.
Even worse, he told me that <strong> and <em> tags around your keyword had absolutely no effect on SEO rankings. Once again maybe something that could be argued either way, but I think it is probably up there with things that you should do anyway. You can check out here for SEOMoz talking about different ranking factors : http://www.seomoz.org/article/search-ranking-factors#ranking-factors
Anyway, I am drifting off my original point here. The SEO Developer also mentioned that our department also hired an external SEO company to work on our sites. After asking them what they did, it seemed they made several onpage SEO enhancements. e.g. Keyword in title tag, keyword in H1 tag. The usual on-page SEO stuff. I questioned about inbound links and what they were doing offsite SEO wise. The other guys in my team didn’t 100% know the answer, but said that before we hired them, we weren’t ranking at all, and now we were.
ooookkaaayyy
Let me just point out something here. The website in question is one of the largest, (probably top 2) in it’s industry. There are 173k links pointing to this site, of which 158k are pointing to the homepage. The homepage is a PR5 page. However before the SEO company was hired, the keywords they “wanted” to rank for were not in the title or H1 tag at all. This alone would (in my eyes) make them very slim chance of making it to the front page for this particular keyword.
So the SEO company changes the H1 and title tag to be the exact keyword. And we start ranking. But is that an example of how a SEO company can get us ranking? Even though the website itself had over 173 thousand links pointing to it before they even got going.
That is what you call money for nothing kids.
O and just FYI. The SEO company itself does not rank for it’s title keywords within Google.com or Google.co.nz. If that isn’t a good indication of who is ranking us, then I don’t know what is.
Mix keyword research with seo and great content and you should get ranked! Just keep it simple.
Posted by
Unknown
at
5:25 PM
0
comments
Thursday, June 9, 2011
Amazing Bed and Breakfast - Changing Lanes Pukekohe NZ
If it's time to take a break, a weekend away, a romantic couple of nights for husband and wife, or maybe your honeymoon then check out http://changinglanespukekohenz.cz.cc A beautiful, safe, romantic honeymoon hideaway.
Posted by
Unknown
at
8:47 PM
0
comments
Wednesday, June 8, 2011
Plugin to Remove Comments Completely from WordPress
Sometimes Wordpress is perfect for what you want except you do not need Comments! Yes you can manually disable them, and then you are backwards and forwards editing because you forgot to turn them off. Now you can have a plugin and have them removed site wide.
Posted by
Unknown
at
7:30 PM
0
comments
Plugin to Remove Comments Completely from WordPress
Sometimes Wordpress is perfect for what you want except you do not need Comments! Yes you can manually disable them, and then you are backwards and forwards editing because you forgot to turn them off. Now you can have a plugin and have them removed site wide>
Posted by
Unknown
at
7:25 PM
0
comments
Plugin to Remove Comments Completely from WordPress
Sometimes Wordpress is perfect for what you want except you do not need Comments! Yes you can manually disable them, and then you are backwards and forwards editing because you forgot to turn them off. Now you can have a plugin and have them removed site wide>
Posted by
Unknown
at
7:24 PM
0
comments
Thursday, May 12, 2011
4 Ways to Loop with WordPress
At the heart of the WordPress theme template is the venerable WordPress loop. When you’re looking at your
index.phpfile, for example, the loop is the part that typically begins withif(have_posts())and contains all the tags and markup used to generate the page. The default loop works perfectly well for most single-loop themes, but for more advanced designs with stuff like multiple and custom loops, more looping power is needed. Fortunately, WordPress provides plenty of flexibility with four ways to loop:
Each of these looping methods is useful in a variety of situations. They share a lot of the same underlying functionality, and the query parameters are essentially the same. Collectively, these four techniques enable simple loops, multiple loops, and custom loops in your WordPress theme template. A good place to find a default loop, for example, is in your theme’s
index.phpfile. Its purpose is to loop through the posts stored in the database and echo their contents to the browser. Using WordPress’ template tags, it’s easy to display post titles, content, meta info, and much more. That said, let’s examine the four ways to loop with WordPress.The Default Loop
The default WordPress loop looks something like this:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div <?php post_class(); ?> id="post-<?php the_ID(); ?>"> <h1></h1> <?php the_content(); ?> </div> <?php endwhile; ?> <div class="navigation"> <div class="next-posts"><?php next_posts_link(); ?></div> <div class="prev-posts"><?php previous_posts_link(); ?></div> </div> <?php else : ?> <div <?php post_class(); ?> id="post-<?php the_ID(); ?>"> <h1>Not Found</h1> </div> <?php endif; ?>So what makes it “default”? Mostly because it uses the default query to loop through post content, making it the loop used like 99% of the time for most themes. It tells WordPress to loop through posts and display the information according to context, and as called by the various template tags (
the_title,the_content, et al). There are tags available for just about any type of data stored in the database.Based on the query that is sent, the default loop will display a certain number of posts from a certain category from a certain date, and so on. For example, the number of posts displayed in the first part of the loop is specified in the WP Admin. So if someone requests the second page of your “Awesome” category, that information is sent via the query, along with the number of posts, theme template file, and so on.
So the default loop is perfect if you’re happy with the query that is sent, but it is also possible to customize the query and generate an entirely different set of posts.
Loop with query_posts()
The query_posts function enables us to modify the query and display our desired results. We can either override the entire query or keep it around and just change a few parameters. Here’s an example where
query_postsis called before the default loop to exclude a specific category:<?php global $query_string; // required $posts = query_posts($query_string.'&cat=-9'); // exclude category 9 <?php // DEFAULT LOOP GOES HERE ?> <?php wp_reset_query(); // reset the query ?>Say you have a default loop in your
index.phptheme template, but you want to change the number of posts, exclude two categories, and display the results in ascending order. Easy. Just add somequery_postsaction before the default loop andwp_reset_queryimmediately after, like this:<?php global $query_string; // required $posts = query_posts($query_string.'&posts_per_page=3&cat=-6,-9&order=ASC'); <?php // DEFAULT LOOP GOES HERE ?> <?php wp_reset_query(); // reset the query ?>Here we are keeping the original query around and just overriding a few parameters. There are many parameters available, so customizing any default loop is accomplished quite easily. If we wanted to completely override the original query, we would replace the second line with something like this:
$posts = query_posts('posts_per_page=3&cat=-6,-9&order=ASC');Notice here that we’ve removed the
$query_stringfrom thequery_postsparameters. This essentially erases the default query and replaces it with one that contains only those variables included inquery_posts. This means no paging information will be available, so remove the original query only if you know what you’re doing.When to use? Use
query_poststo modify the type of posts that are returned for a single loop. It’s perfect for limiting the number of posts, excluding posts from a certain category or tag, and so on. If more than one loop is required, multiplequery_postsloops could work, but there is a much better way to do it usingWP_Query.Loop with WP_Query()
For complete control over the customization of any number of loops, WP_Query is the way to go. When used to modify a default loop, it looks similar to
query_posts. For example, let’s exclude a specific category usingWP_Query:<?php $custom_query = new WP_Query('cat=-9'); // exclude category 9 while($custom_query->have_posts()) : $custom_query->the_post(); ?> <div <?php post_class(); ?> id="post-<?php the_ID(); ?>"> <h1></h1> <?php the_content(); ?> </div> <?php endwhile; ?> <?php wp_reset_postdata(); // reset the query ?>It also accepts the same parameters as
query_posts, so modifying stuff like number of posts, included/excluded categories, and post order looks quite familiar. As seen in the following examples,WP_Querymakes it easy to customize the loop by simply changing the parameter:$custom_query = new WP_Query('cat=-7,-8,-9'); // exclude any categories $custom_query = new WP_Query('posts_per_page=3'); // limit number of posts $custom_query = new WP_Query('order=ASC'); // reverse the post orderAs expected, we can combine parameters with
WP_Queryusing the same syntax as bothquery_postsandget_posts. Here’s the equivalent of ourquery_postsexample:
$custom_query = new WP_Query('posts_per_page=3&cat=-6,-9&order=ASC');Notice, however, that with
WP_Query, we don’t need the$query_stringvariable. In addition to usingWP_Queryto customize the default loop, we can also use it to create and customize multiple loops. Here is a basic example:<?php // Loop 1 $first_query = new WP_Query('cat=-1'); // exclude category while($first_query->have_posts()) : $first_query->the_post(); ... endwhile; wp_reset_postdata(); // Loop 2 $second_query = new WP_Query('cat=-2'); // exclude category while($second_query->have_posts()) : $second_query->the_post(); ... endwhile; wp_reset_postdata(); // Loop 3 $third_query = new WP_Query('cat=-3'); // exclude category while($third_query->have_posts()) : $third_query->the_post(); ... endwhile; wp_reset_postdata(); ?>Each of these additional loops may be placed anywhere in your theme template – no need to line them up sequentially. For example, one loop may be placed in your sidebar, another in your footer, and so on. And with the output of each loop easily modified using any of the available parameters, any loop configuration is possible.
When to use? Use
WP_Queryfor creating multiple, customized loops. By setting up additional instances ofWP_Queryin your theme, you can create any number of multiple loops, and customize the output of each.Even so, we don’t always need to break out the big guns, sometimes we just need a few additional loops displayed around the page. So let’s put down the bazookas and gather in the garden for some
get_poststea ;)Loop with get_posts()
The easiest, safest way to create multiple loops in your theme is to use get_posts(). Anywhere you need to display a quick, static set of posts,
get_postsis the perfect choice. Think 10 recent posts in the sidebar, or 10 random posts in the footer.get_postsmakes it easy. Here again is a query to exclude a specific category:<?php global $post; // required $args = array('category' => -9); // exclude category 9 $custom_posts = get_posts($args); foreach($custom_posts as $post) : setup_postdata($post); ... endforeach; ?>This code creates a loop of all posts except those in the excluded category. Of course, excluding a category is just one way to customize your additional, static loops. By using any of the same parameters accepted by
WP_Queryandquery_posts, it’s possible to create loops that display just about anything you want.Notice, however, that
get_postsrequires the use of an array for the parameters. The format for multiple parameters looks like this (using our previous example):
$args = array('numberposts'=>3, 'category'=>-6,-9, 'order'=>'ASC');Also notice that we’re using
numberpostsinstead ofposts_per_pageto limit the number of posts. According to the WP Codex,posts_per_pageshould work withget_posts, but if it doesn’t just go withnumberposts. There is also ashowpostsparameter that also seems to work fine withget_posts.When to use? Use the
get_posts()function to easily create additional, static loops anywhere in your theme.get_postsaccepts the same parameters asquery_posts, and is perfect for adding static, custom loops to your sidebar, footer, or anywhere else.30-Second Summary
The bottom line for customizing default loops and creating multiple loops:
- To modify the default loop, use
query_posts()- To modify loops and/or create multiple loops, use
WP_Query()- To create static, additional loops, use
get_posts()If you’re working with WordPress loops and want to learn more about using them to customize your theme, we cover the topic extensively in our book, Digging into WordPress, which is current with WordPress 3.1 :)
Possibly Related Posts
Working with the Wordpress "Loop"
Posted by
Unknown
at
6:52 PM
0
comments