Categories
Archives
logo  

A discussion of earning with Affiliate Programs, SEO, Wordpress Blogging and General Motivational Ideas for Internet Publishers



Blog Post Wordpress Hack : SEO Friendly Titles

Posted in Search Engine Optimization, Wordpress, Wordpress Hacks by Dave on the October 7th, 2007

Wordpress Logo Wordpress is the greatest blogging software ever created, however there are a few issues with a standard Wordpress install aren’t exactly the most SEO (Search Engine Optimization) friendly if you’re running straight “out of the box”. Particularly the way Wordpress handles page titles for individual post pages. Below is an example of a standard Wordpress installs handling of the html “title” tag. As is common knowledge in the SEO community, beside your domain name, the actual title that appears in the titlebar of the browser is one of the most essential aspects for ranking your posts high in the search engines, especially true with Google who has recently started bumping new articles up in the rankings and gradually fading them as the article becomes less relevant. If you’re a blogger like me, most of my articles are not particualrly time sensitive, so it is essential to have an effective title for each individual post that will sustain higher rankings over along period of time.

To begin with, choosing a short, yet descriptive title is imperative to gaining high rankings for your targeted keyowrds. Stuffing your html title is a definite mistake because in many an SEO’s experience, Google has a knack for singling out the keywords you’re not particularly trying to get ranked for. The old adage K.I.S.S (Keep it Simple Stupid) absolutely applies to standard webpages but it the single most important trick you can use to get your posts ranked high and keep them there as long as your article’s content is relative to your title.

Below is an example of the standard Wordpress install’s code to generate your blog titles :

<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>

With this standard code your individual blog post pages will have a very ugly and SEO unfriendly title as shown below…

Wordpress Title Example 1

A much better title for your individual posts would look like this…

Wordpress Title Example 2

To accomplish this, all you have to do is replace the standard code shown above with this much more SEO friendly code:
</p> <table width="580" cellpadding="2" cellspacing="0" style="border:#444444 1px solid;"> <tr> <td> <title><br /> <?php if ( is_single() ) {<br /> wp_title('', true);<br /> }else{<br /> bloginfo('name');<br /> wp_title();<br /> }?><br /> </title> </td> </tr> </table> <p>Depending on what theme you’re using, the file to edit will be in your /wp-content/themes/yourtheme directory and if there isn’t a file named header.php (which is the usual edit spot), you will be editing the file index.php.</p> <p>Happy <a href="http://technorati.com/tag/Wordpress+Hack" style="font-weight: normal; color:#000000; text-decoration: none" rel="tag">Wordpress Hack</a>ing</p> <div class="comments"><div style="float:right;"><span id="wp-notable-line" class="wp-notable-line"><span class="wp-notable" id="wp-notable-delicious" ><a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-seo-friendly-titles%2F&title=Wordpress+Hack+%3A+SEO+Friendly+Titles" title="del.icio.us:Wordpress Hack : SEO Friendly Titles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/delicious.png" border="0" class="wp-notable_image" alt="del.icio.us:Wordpress Hack : SEO Friendly Titles" /></a></span > <span class="wp-notable" id="wp-notable-newsvine" ><a href="http://www.newsvine.com/_tools/seed&save?u=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-seo-friendly-titles%2F&h=Wordpress+Hack+%3A+SEO+Friendly+Titles" title="newsvine:Wordpress Hack : SEO Friendly Titles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/newsvine.png" border="0" class="wp-notable_image" alt="newsvine:Wordpress Hack : SEO Friendly Titles" /></a></span > <span class="wp-notable" id="wp-notable-furl" ><a href="http://www.furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-seo-friendly-titles%2F&t=Wordpress+Hack+%3A+SEO+Friendly+Titles" title="furl:Wordpress Hack : SEO Friendly Titles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/furl.png" border="0" class="wp-notable_image" alt="furl:Wordpress Hack : SEO Friendly Titles" /></a></span > <span class="wp-notable" id="wp-notable-reddit" ><a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-seo-friendly-titles%2F&title=Wordpress+Hack+%3A+SEO+Friendly+Titles" title="reddit:Wordpress Hack : SEO Friendly Titles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/reddit.png" border="0" class="wp-notable_image" alt="reddit:Wordpress Hack : SEO Friendly Titles" /></a></span > <span class="wp-notable" id="wp-notable-blogmarks" ><a href="http://blogmarks.net/my/new.php?mini=1&simple=1&url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-seo-friendly-titles%2F&title=Wordpress+Hack+%3A+SEO+Friendly+Titles" title="blogmarks:Wordpress Hack : SEO Friendly Titles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/blogmarks.png" border="0" class="wp-notable_image" alt="blogmarks:Wordpress Hack : SEO Friendly Titles" /></a></span > <span class="wp-notable" id="wp-notable-yahoo" ><a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-seo-friendly-titles%2F&t=Wordpress+Hack+%3A+SEO+Friendly+Titles" title="Y!:Wordpress Hack : SEO Friendly Titles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/yahoo.png" border="0" class="wp-notable_image" alt="Y!:Wordpress Hack : SEO Friendly Titles" /></a></span > <span class="wp-notable" id="wp-notable-smarking" ><a href="http://smarking.com/editbookmark/?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-seo-friendly-titles%2F" title="smarking:Wordpress Hack : SEO Friendly Titles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/smarking.png" border="0" class="wp-notable_image" alt="smarking:Wordpress Hack : SEO Friendly Titles" /></a></span > <span class="wp-notable" id="wp-notable-magnolia" ><a href="http://ma.gnolia.com/bookmarklet/add?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-seo-friendly-titles%2F&title=Wordpress+Hack+%3A+SEO+Friendly+Titles" title="magnolia:Wordpress Hack : SEO Friendly Titles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/magnolia.png" border="0" class="wp-notable_image" alt="magnolia:Wordpress Hack : SEO Friendly Titles" /></a></span > <span class="wp-notable" id="wp-notable-segnalo" ><a href="http://segnalo.com/post.html.php?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-seo-friendly-titles%2F&title=Wordpress+Hack+%3A+SEO+Friendly+Titles" title="segnalo:Wordpress Hack : SEO Friendly Titles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/segnalo.png" border="0" class="wp-notable_image" alt="segnalo:Wordpress Hack : SEO Friendly Titles" /></a></span > <span class="wp-notable" id="wp-notable-gifttagging" ><a href="http://www.gifttagging.com/gift/add?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-seo-friendly-titles%2F&title=Wordpress+Hack+%3A+SEO+Friendly+Titles" title="gifttagging:Wordpress Hack : SEO Friendly Titles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/gifttagging.png" border="0" class="wp-notable_image" alt="gifttagging:Wordpress Hack : SEO Friendly Titles" /></a></span ></span></div><div style="float:left;"<a href="http://www.affiliatebestprograms.com/wordpress-hack-seo-friendly-titles/#comments" title="Comment on Wordpress Hack : SEO Friendly Titles"><strong>1</strong> Comment</a> <a href="http://www.affiliatebestprograms.com/wordpress-hack-seo-friendly-titles/" rel="bookmark" class="Permalink" title="Permalink to Wordpress Hack : SEO Friendly Titles">Permalink</a><br /> <br /></div></div> </div> </div> <h2 id="post-60" style="padding-left:7px;"><img src="/images/blog_post.gif" alt="Blog Post"> <a href="http://www.affiliatebestprograms.com/wordpress-hack-add-a-digg-button-to-your-posts/" rel="bookmark">Wordpress Hack : Add a Digg Button to Your Posts</a></h2> <div class="meta">Posted in <a href="http://www.affiliatebestprograms.com/category/search-engine-optimization/" title="View all posts in Search Engine Optimization" rel="category tag">Search Engine Optimization</a>, <a href="http://www.affiliatebestprograms.com/category/wordpress-hacks/" title="View all posts in Wordpress Hacks" rel="category tag">Wordpress Hacks</a> by Dave on the July 31st, 2007 </div> <div class="main"> <div class="storycontent"> <p><img src="/images/digg.jpg" alt="Digg Logo" style="margin-right:6px; float: left;">I know there’s several <a href="http://technorati.com/tag/Wordpress+Plugins" style="font-weight: normal; color:#444444; text-decoration: none" rel="tag">Wordpress Plugins</a> available to add a “Digg It” button to your Wordpress blog, but I still prefer to add hacks in my Wordpress theme to accomplish the functionality without having to bother searching for, downloading and installing a Wordpress Plugin. As a webmaster with several Wordpress blogs and several different versions, I find it easier just to pop open my <a href="http://technorati.com/tag/Zend+Enviornment" style="font-weight: normal; color:#444444; text-decoration: none" rel="tag">Zend Enviornment</a> and edit the PHP code by hand. Here’s a quick and dirty way to add a “Digg It” button into your blog posts. It takes all of 5 minutes to complete. This example will add a Digg button like the one’s on this blog, in the upper left hand corner of every post. This will make it easier for your readers to Digg articles they like. It is advisable to place the “Digg It” button someplace easy for your readers to see so that they don’t have to do much searching to digg or review your articles.<br /> <br /> <b>Step 1:</b> Open the file <i>/wp-content/themes/*your-theme-name*/index.php</i> and look for the following code:<br /> <br /> <textarea class="code_ta" rows="1" cols="60"><?php the_content(__('(more…)')); ?></textarea><br /> <br /> Please note: the code may also look like this…<br /> <textarea class="code_ta" rows="1" cols="60"><?php the_content(__('Read more »')); ?></textarea><br /> <br /> Either way you’re looking for the beginning of the post content output loop if you want your Digg It widget as it appears on this site in the upper left hand corner of every blog post.<br /> <br /> <b>Step 2:</b> Add the following code directly <i>before</i> the code listed above.<br /> <br /> <textarea class="code_ta" rows="8" cols="80" wrap="physical"> <div style="float:left; margin: 0px 10px 0px 0px;"> <script type="text/javascript"> digg_url="<?php the_permalink() ?>“; </script> <script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script> </div> <p></textarea></p> <p><span style="color:#cc0000;">****Please note (added 8/10/2007): If you’re having a problem copying and pasting this code from the blog, please go to this page to copy and paste the code…</span><br /> <a href="http://www.affiliatebestprograms.com/Wordpress_digg_code.html" style="color:#00cc00;" target="_blank">http://www.affiliatebestprograms.com/Wordpress_digg_code.htm</a></p> <p>Note: you can add it anywhere you want in your post loop. For example, if you want it on the right of every post all you have to do is change “float:left” to “float:right”. If you want the widget at he bottom of your posts, allyou have to do is add it after the code from step 1. Experiment with it and have fun.<br /> <br/><br /> <b>About Digg</b><br /> <a href="http://technorati.com/tag/Digg" style="font-weight: normal; color:#444444; text-decoration: none" rel="tag">Digg</a> is a <a href="http://technorati.com/tag/Social+Networking" style="font-weight: normal; color:#444444; text-decoration: none" rel="tag">Social Networking</a> and bookmarking website that allows members to submit stories and have other people vote on them to increase you article’s popularity. If you can get an article dugg a lot of times, you will certainly be getting a lot of hits from Digg users. Digg is primarily technology oriented, however they have been expanding the service to include other types of articles. I would also advise against trying to cheat the Digg system by registering multiple accounts and digging your own stories because you will find yourself banned and all your stories removed.</p> <p>There are additional ways to customize the look and feel of the Digg widget that are not covered in this article and if you’re interested in extending the functionality, visit the <a href="http://www.digg.com/tools" title="Digg Tools" style="color:#7DA721;" target="_blank">Digg Tools Page</a><br /> <br/><br /> If anybody has any questions about how to implement this code, feel free to post a comment here. If you are using this code in your blog, please post a comment with a link to your site so we can see it. We are a “dofollow” blog and we reward our commentors with backlinks for posting well written, intelligent comments.<br /> <br/><br /> Happy Publishing !!</p> <div class="comments"><div style="float:right;"><span id="wp-notable-line" class="wp-notable-line"><span class="wp-notable" id="wp-notable-delicious" ><a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-add-a-digg-button-to-your-posts%2F&title=Wordpress+Hack+%3A+Add+a+Digg+Button+to+Your+Posts+" title="del.icio.us:Wordpress Hack : Add a Digg Button to Your Posts " rel="nofollow"><img src="/wp-content/plugins/blogbling/images/delicious.png" border="0" class="wp-notable_image" alt="del.icio.us:Wordpress Hack : Add a Digg Button to Your Posts " /></a></span > <span class="wp-notable" id="wp-notable-newsvine" ><a href="http://www.newsvine.com/_tools/seed&save?u=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-add-a-digg-button-to-your-posts%2F&h=Wordpress+Hack+%3A+Add+a+Digg+Button+to+Your+Posts+" title="newsvine:Wordpress Hack : Add a Digg Button to Your Posts " rel="nofollow"><img src="/wp-content/plugins/blogbling/images/newsvine.png" border="0" class="wp-notable_image" alt="newsvine:Wordpress Hack : Add a Digg Button to Your Posts " /></a></span > <span class="wp-notable" id="wp-notable-furl" ><a href="http://www.furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-add-a-digg-button-to-your-posts%2F&t=Wordpress+Hack+%3A+Add+a+Digg+Button+to+Your+Posts+" title="furl:Wordpress Hack : Add a Digg Button to Your Posts " rel="nofollow"><img src="/wp-content/plugins/blogbling/images/furl.png" border="0" class="wp-notable_image" alt="furl:Wordpress Hack : Add a Digg Button to Your Posts " /></a></span > <span class="wp-notable" id="wp-notable-reddit" ><a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-add-a-digg-button-to-your-posts%2F&title=Wordpress+Hack+%3A+Add+a+Digg+Button+to+Your+Posts+" title="reddit:Wordpress Hack : Add a Digg Button to Your Posts " rel="nofollow"><img src="/wp-content/plugins/blogbling/images/reddit.png" border="0" class="wp-notable_image" alt="reddit:Wordpress Hack : Add a Digg Button to Your Posts " /></a></span > <span class="wp-notable" id="wp-notable-blogmarks" ><a href="http://blogmarks.net/my/new.php?mini=1&simple=1&url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-add-a-digg-button-to-your-posts%2F&title=Wordpress+Hack+%3A+Add+a+Digg+Button+to+Your+Posts+" title="blogmarks:Wordpress Hack : Add a Digg Button to Your Posts " rel="nofollow"><img src="/wp-content/plugins/blogbling/images/blogmarks.png" border="0" class="wp-notable_image" alt="blogmarks:Wordpress Hack : Add a Digg Button to Your Posts " /></a></span > <span class="wp-notable" id="wp-notable-yahoo" ><a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-add-a-digg-button-to-your-posts%2F&t=Wordpress+Hack+%3A+Add+a+Digg+Button+to+Your+Posts+" title="Y!:Wordpress Hack : Add a Digg Button to Your Posts " rel="nofollow"><img src="/wp-content/plugins/blogbling/images/yahoo.png" border="0" class="wp-notable_image" alt="Y!:Wordpress Hack : Add a Digg Button to Your Posts " /></a></span > <span class="wp-notable" id="wp-notable-smarking" ><a href="http://smarking.com/editbookmark/?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-add-a-digg-button-to-your-posts%2F" title="smarking:Wordpress Hack : Add a Digg Button to Your Posts " rel="nofollow"><img src="/wp-content/plugins/blogbling/images/smarking.png" border="0" class="wp-notable_image" alt="smarking:Wordpress Hack : Add a Digg Button to Your Posts " /></a></span > <span class="wp-notable" id="wp-notable-magnolia" ><a href="http://ma.gnolia.com/bookmarklet/add?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-add-a-digg-button-to-your-posts%2F&title=Wordpress+Hack+%3A+Add+a+Digg+Button+to+Your+Posts+" title="magnolia:Wordpress Hack : Add a Digg Button to Your Posts " rel="nofollow"><img src="/wp-content/plugins/blogbling/images/magnolia.png" border="0" class="wp-notable_image" alt="magnolia:Wordpress Hack : Add a Digg Button to Your Posts " /></a></span > <span class="wp-notable" id="wp-notable-segnalo" ><a href="http://segnalo.com/post.html.php?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-add-a-digg-button-to-your-posts%2F&title=Wordpress+Hack+%3A+Add+a+Digg+Button+to+Your+Posts+" title="segnalo:Wordpress Hack : Add a Digg Button to Your Posts " rel="nofollow"><img src="/wp-content/plugins/blogbling/images/segnalo.png" border="0" class="wp-notable_image" alt="segnalo:Wordpress Hack : Add a Digg Button to Your Posts " /></a></span > <span class="wp-notable" id="wp-notable-gifttagging" ><a href="http://www.gifttagging.com/gift/add?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-add-a-digg-button-to-your-posts%2F&title=Wordpress+Hack+%3A+Add+a+Digg+Button+to+Your+Posts+" title="gifttagging:Wordpress Hack : Add a Digg Button to Your Posts " rel="nofollow"><img src="/wp-content/plugins/blogbling/images/gifttagging.png" border="0" class="wp-notable_image" alt="gifttagging:Wordpress Hack : Add a Digg Button to Your Posts " /></a></span ></span></div><div style="float:left;"<a href="http://www.affiliatebestprograms.com/wordpress-hack-add-a-digg-button-to-your-posts/#comments" title="Comment on Wordpress Hack : Add a Digg Button to Your Posts"><strong>16</strong> Comments</a> <a href="http://www.affiliatebestprograms.com/wordpress-hack-add-a-digg-button-to-your-posts/" rel="bookmark" class="Permalink" title="Permalink to Wordpress Hack : Add a Digg Button to Your Posts">Permalink</a><br /> <br /></div></div> </div> </div> <h2 id="post-57" style="padding-left:7px;"><img src="/images/blog_post.gif" alt="Blog Post"> <a href="http://www.affiliatebestprograms.com/wordpress-hack-most-popular-articles/" rel="bookmark">Wordpress Hack : Most Popular Articles</a></h2> <div class="meta">Posted in <a href="http://www.affiliatebestprograms.com/category/wordpress-hacks/" title="View all posts in Wordpress Hacks" rel="category tag">Wordpress Hacks</a> by Dave on the July 24th, 2007 </div> <div class="main"> <div class="storycontent"> <p>Being a software developer and programmer by trade, sometimes I find it easier to crack open my Zen Develpoment Enviornment and hack my <a href="http://technorati.com/tag/Wordpress" style="font-weight: normal; color:#444444; text-decoration: none" rel="tag">Wordpress</a> theme rather than search for an appropriate plugin that may or may not work. Today, I was fooling around with optimizong my blogs and wanted to add a “Most Popular Articles” list to my blogs sidebar so I came up with a quick hack. In addition to the sidebar list, I decided to go a step further and add a custom page that listed the 20 most popular articles based on user comments. Wordpress doesn’t natively support PHP code in posts or pages and I wasn’t in the mood to tinker with the phpexec plugin which didn’t seem to work, so I spent another 5 minutes to create another simple hack. </p> <p>I’ve decided to share these hacks with any of you Wordpress bloggers out there who might be interested. So here’s how to add a simple “Most Popular Articles” box to your blog.</p> <p><b>Hacking the "Most Popular Articles List"</b><br /> Open your theme’s file wherever you’d like to place the list. In this case, I edited my sidebar.php file, however in some themes you may have to edit your index.php file. Insert the following code in the spot you want to see the list:</p> <table cellpadding=2 cellspacing=0 style="border:#444444 1px solid;"> <tr> <td> <?php<br /> $sql = "SELECT post_date, post_title, post_name, comment_count from wp_posts ORDER BY comment_count DESC LIMIT 7";<br /> $searches = $wpdb->get_results($sql);</p> <p> echo '<table border="0" cellpadding="0" cellspacing="1" width="180"><br /><br /> <tr><td style="border-bottom:#A27C08 1px solid;"><b>Most Popular Articles</b></td></tr>';</p> <p> foreach ( $searches as $searchz ){<br /> $dtp = explode(" ", $searchz->post_date);<br /> $tdstr = preg_replace("/\-/", "/", $dtp[0]);<br /> echo '<tr><td><img src="/images/green_star.png" alt="green star" style="margin: 0px 0px 0px 2px;"><br /> <a href="http://www.yourdomain.com/' . $tdstr . '/' . $searchz->post_name . <br /> '" title="' . $searchz->post_title . '">' . $searchz->post_title . '</a></td></tr>';<br /> }</p> <p>echo '<tr><td style="border-top:#A27C08 1px solid;"><br /><br /> <a href="http://www.yourdomain.com/most-popular-articles/" title="Most Popular Articles"><br /> 20 Most Popular Articles…</a></td></tr></table>';<br /> ?> </td> </tr> </table> <p>* Please note, this example is assuming you have Permalinks turned on. You must edit “yourdomain.com” to reflect your domain and make sure the path to your blog is correct. In this example the blog is installed in the root directory of the webserver. You can easily edit the number of articles by changing “LIMIT 7″ to the number of posts you would like to list. The “green-star.png” bullet is optional and you can either remove the <img> tag or if you’s like to use your own image, you can change it to whatever you like. If you need a bullet image, there are quite a few nic ones for free download at <a href="http://www.stylegala.com/features/bulletmadness/" style="color:#7DA721;" target="_blank">Bullet Madness</a>.</p> <p><b>Hacking the "Most Popular Articles Page"</b><br /> <br /> First, login to your Wordpress installation and in your dashboard, select Manage > Pages > Create New Page and create a new page titled “Most Popular Articles”. Add whatever heading or text you want at the beginning of the page and publish the page.</p> <p>After your Most Popular Articles Page has been saved, Open your themes index page where the content loop is and find this line <i>(note: if you’re using default theme on the newest Wordpress release the file you need to edit is single.php) </i>:</p> <table cellpadding=2 cellspacing=0 style="border:#444444 1px solid;"> <tr> <td> <?php the_content(__('(more…)')); ?> </td> </tr> </table> <p>and replace it with this…</p> <table cellpadding=2 cellspacing=0 style="border:#444444 1px solid;"> <tr> <td> <?php </p> <p>the_content(__('(more…)')); </p> <p>/* Handle the most Popular Posts Here */<br /> if ( $_SERVER['REQUEST_URI'] == '/most-popular-articles/' ){<br /> $sql = "SELECT post_date, post_title, post_name, comment_count from wp_posts ORDER BY comment_count DESC LIMIT 20";</p> <p>$searches = $wpdb->get_results($sql);</p> <p>echo '<table border="0" cellpadding="0" cellspacing="1" width="500"><br /><br /> <tr><td colspan="2"><b>20 Most Popular Articles</b><br /><small>* Ordered by number of comments<small><br /><br /></td></tr>';</p> <p>foreach ( $searches as $searchz ){<br /> $dtp = explode(" ", $searchz->post_date);<br /> $tdstr = preg_replace("/\-/", "/", $dtp[0]);<br /> echo '<tr><td>' . $searchz->comment_count . '</td><td><img src="/images/green_star.png" alt="green star" style="margin: 0px 0px 0px 2px;"> <br /> <a href="http://www.yourdomain.com/' . $tdstr . '/' . $searchz->post_name . '" title="' . $searchz->post_title .<br /> '">' . $searchz->post_title . '</a></td></tr>';<br /> }</p> <p>echo "</table><br /><br />"; <br /> }<br /> /* End Popular Posts Here */</p> <p>?> </td> </tr> </table> <p>As with the previous step, you must edit “yourdomain.com” and do what you want with the bullet image. How this works is that the code will look for a single page ending with “/most-popular-articles/”, so if you wanted to name your custom page something else, you must edit the code above to reflect your choices.</p> <p>That’s it, quick and simple hack to add a “Most Popular Articles” list and page to your Wordpress blog.</p> <p>If you found this post helpful, please take a moment and Digg It and/or post a comment. The “nofollow” attribute is turned off on my comments page, so you’ll not only be letting me know you found this article useful, you’ll also be getting a nice <a href="http://technorati.com/tag/backlink" style="font-weight: normal; color:#444444; text-decoration: none" rel="tag">backlink</a>.</p> <p>Cheers !!!</p> <div class="comments"><div style="float:right;"><span id="wp-notable-line" class="wp-notable-line"><span class="wp-notable" id="wp-notable-delicious" ><a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-most-popular-articles%2F&title=Wordpress+Hack+%3A+Most+Popular+Articles" title="del.icio.us:Wordpress Hack : Most Popular Articles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/delicious.png" border="0" class="wp-notable_image" alt="del.icio.us:Wordpress Hack : Most Popular Articles" /></a></span > <span class="wp-notable" id="wp-notable-newsvine" ><a href="http://www.newsvine.com/_tools/seed&save?u=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-most-popular-articles%2F&h=Wordpress+Hack+%3A+Most+Popular+Articles" title="newsvine:Wordpress Hack : Most Popular Articles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/newsvine.png" border="0" class="wp-notable_image" alt="newsvine:Wordpress Hack : Most Popular Articles" /></a></span > <span class="wp-notable" id="wp-notable-furl" ><a href="http://www.furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-most-popular-articles%2F&t=Wordpress+Hack+%3A+Most+Popular+Articles" title="furl:Wordpress Hack : Most Popular Articles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/furl.png" border="0" class="wp-notable_image" alt="furl:Wordpress Hack : Most Popular Articles" /></a></span > <span class="wp-notable" id="wp-notable-reddit" ><a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-most-popular-articles%2F&title=Wordpress+Hack+%3A+Most+Popular+Articles" title="reddit:Wordpress Hack : Most Popular Articles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/reddit.png" border="0" class="wp-notable_image" alt="reddit:Wordpress Hack : Most Popular Articles" /></a></span > <span class="wp-notable" id="wp-notable-blogmarks" ><a href="http://blogmarks.net/my/new.php?mini=1&simple=1&url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-most-popular-articles%2F&title=Wordpress+Hack+%3A+Most+Popular+Articles" title="blogmarks:Wordpress Hack : Most Popular Articles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/blogmarks.png" border="0" class="wp-notable_image" alt="blogmarks:Wordpress Hack : Most Popular Articles" /></a></span > <span class="wp-notable" id="wp-notable-yahoo" ><a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-most-popular-articles%2F&t=Wordpress+Hack+%3A+Most+Popular+Articles" title="Y!:Wordpress Hack : Most Popular Articles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/yahoo.png" border="0" class="wp-notable_image" alt="Y!:Wordpress Hack : Most Popular Articles" /></a></span > <span class="wp-notable" id="wp-notable-smarking" ><a href="http://smarking.com/editbookmark/?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-most-popular-articles%2F" title="smarking:Wordpress Hack : Most Popular Articles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/smarking.png" border="0" class="wp-notable_image" alt="smarking:Wordpress Hack : Most Popular Articles" /></a></span > <span class="wp-notable" id="wp-notable-magnolia" ><a href="http://ma.gnolia.com/bookmarklet/add?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-most-popular-articles%2F&title=Wordpress+Hack+%3A+Most+Popular+Articles" title="magnolia:Wordpress Hack : Most Popular Articles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/magnolia.png" border="0" class="wp-notable_image" alt="magnolia:Wordpress Hack : Most Popular Articles" /></a></span > <span class="wp-notable" id="wp-notable-segnalo" ><a href="http://segnalo.com/post.html.php?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-most-popular-articles%2F&title=Wordpress+Hack+%3A+Most+Popular+Articles" title="segnalo:Wordpress Hack : Most Popular Articles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/segnalo.png" border="0" class="wp-notable_image" alt="segnalo:Wordpress Hack : Most Popular Articles" /></a></span > <span class="wp-notable" id="wp-notable-gifttagging" ><a href="http://www.gifttagging.com/gift/add?url=http%3A%2F%2Fwww.affiliatebestprograms.com%2Fwordpress-hack-most-popular-articles%2F&title=Wordpress+Hack+%3A+Most+Popular+Articles" title="gifttagging:Wordpress Hack : Most Popular Articles" rel="nofollow"><img src="/wp-content/plugins/blogbling/images/gifttagging.png" border="0" class="wp-notable_image" alt="gifttagging:Wordpress Hack : Most Popular Articles" /></a></span ></span></div><div style="float:left;"<a href="http://www.affiliatebestprograms.com/wordpress-hack-most-popular-articles/#comments" title="Comment on Wordpress Hack : Most Popular Articles"><strong>23</strong> Comments</a> <a href="http://www.affiliatebestprograms.com/wordpress-hack-most-popular-articles/" rel="bookmark" class="Permalink" title="Permalink to Wordpress Hack : Most Popular Articles">Permalink</a><br /> <br /></div></div> </div> </div> <br /> <span style="margin-left:16px;"></span> </div> <!-- End float clearing --> </div> <!-- End content --> <!-- begin footer --> <hr /> <div id="footer"> <div class="extras"> <ul> <li><a href="http://www.affiliatebestprograms.com/feed/" title="Subscribe to RSS feed">RSS</a></li> <li><a href="feed:http://www.affiliatebestprograms.com/comments/feed/" title="Subscribe to Comments RSS feed">Comments RSS</a></li> <li><a href="http://www.affiliatebestprograms.com/feed/atom/" title="Subscribe to Atom feed">Atom</a></li> <li><a href="http://wordpress.org/" title="Powered by the lovely WordPress">WP</a></li> </ul> </div> </div> </div> </div> </div> </div> </div> <br /> <div id="footnotes"> AffiliateBestPrograms Blog is proudly powered by <a href="http://www.wordpress.org" title="WordPress" style="color:#1D6A0B;">WordPress</a> <br /> Original Content © 2007-2008 <a href="http://www.resdaz.com/our_blogs.html" title="Resdaz Media Blogs" style="color:#1D6A0B;">Resdaz Media LLC.</a> - <i>All Rights Reserved</i> </div> <br /> <br /> Visit some of our other sites : <br><br /> <br /> <script type="text/javascript" language="javascript" src="http://www.dpbolvw.net/placeholder-3009599?target=_top&mouseover=N"></script> </body> </html>