Tag Archives: Wordpress

Improvements for Stattraq plugin.

April 29, 2007 by aaron
Ever since I originally started using Stattraq a few things bothered me about the way it worked. Here are the fixes to a few of them. Include pages with posts in your stats. Open stattraq.php Find: global $doing_rss, $p Replace With: global $doing_rss, $p, $page_id, $pagename, Find: if (($p != &#039;&#039;)){ $p = intval($p); $article_id = $p; } Replace with: if (($p != &#039;&#039;)){ $p = intval($p); $article_id = $p; }elseif (($page_id != &#039;&#039;)){ $page_id = intval($page_id); $article_id = $page_id; }elseif (($pagename != &#039;&#039;)){ $reqpage = get_page_by_path($pagename); if ( !empty($reqpage) ) $article_id = $reqpage->ID; } To add a list of all Pages that link to your site grouped by Website (excluding Google): Open “wp-stattraq/reporter/summary.php” Find: <?php echo PrintTimestamp();?> </div> <div id="queryTerms"> Before Add: <table id="referrersTable"> <thead> <tr> <th>#</th> <th>Referrer</th> <th>Pages</th> </tr> </thead> <tfoot> <tr> <th>#</th> <th>Referrer</th> <th>Pages</th> </tr> </tfoot> <tbody> <?php if($results){ $i=0; foreach($results as $row){ preg_match(&#039;/(http.*?\:\/\/.*?)(\/.*)/&#039;, htmlentities($row->ref), $matches); $ref_array[$matches[1]][] = $matches[2]; } while( list($site, $pages) = @each($ref_array) ){ if(strpos($site,&#039;google&#039;) ==false && $site != &#039;&#039;){?> <tr class="<?php echo ($i % 2 == 0 ?
Read More ⟶

WordPress How To: Easily make an admin panel for a plugin

April 19, 2007 by aaron
I find the Admin panel the most tedious part of plugin development–even the slightest changes to the plugin requires major changes to the Admin panel, and it can be hard to remember every option you have in your plugin. However by following a few simple rules, your next Admin panel will be a breeze. Once you have the basic parts down, new options are just a cut and past away. One thing to note is that his Admin panel uses a few features that are best if repeated inside your plugin itself.
Read More ⟶

WordPress Access Keys Plugin

April 18, 2007 by aaron
The WordPress Access Keys Plugin a allows you to add access keys to pages and categories to improve accessibility of your WordPress website. This works with any page or category list that is called with wp_list pages and wp_list_categories respectively. This plugin works in all WordPRess versions from 2.1 – 2.5. Screenshot of Admin Panel: Demo: The About page on this site has an access key of 6 and the site map has an access key of 3.
Read More ⟶

A few WordPress Tricks.

April 9, 2007 by aaron
Just a few little tips for WordPress: If you don’t want the titles of posts to have the » character before them for SEO purposes just use: < ?php echo trim(wp_title('&raquo;',false), '&raquo; ');?> I was sick of my index.php being used to display pages, so I added the following to the top of my index.php to force WordPress to use single.php for all pages: < ?php if(is_page()){ include(&#039;single.php&#039;); exit; } ?> I wanted to be able to use javascript in some of my pages so I added the following to my header.php: <?php if(is_page()){ $j = get_post_meta($post->ID, &#039;header&#039;, true); if($j != &#039;&#039;){ echo $j; } } ?> Now anytime I need special style or javascript code added for a particular page I just add a custom field with the name header.
Read More ⟶

WordPress Meta Tag/SEO plugin

April 7, 2007 by aaron
I was sick of having a half dozen different plugins to add meta tags and fix the robots, so I wrote a plugin that prevents duplicate content from being indexed by Google, adds useful meta tags, and ensures that all posts are at one single permalink (using 301 redirects of course). This is more a shell of a plugin than an actual plugin as there are no options, and there are obvious flaws such as it doesn’t allow you to use paged posts.
Read More ⟶

Future Posts Calendar Plugin

April 7, 2007 by aaron
I use the future posts a lot. In fact, this post you are reading now was written almost a week before it was posted –actually I used this plugin to post about this plugin, but that is getting off topic. Anyway, if you use future posts a lot also you probably find yourself looking back and forth from your post list to a calendar or recording your future posts on a calendar to avoid having a double post on a single day and then none for three days.
Read More ⟶

Improvements for Stattraq plugin.

April 29, 2007 by aaron
Ever since I originally started using Stattraq a few things bothered me about the way it worked. Here are the fixes to a few of them. Include pages with posts in your stats. Open stattraq.php Find: global $doing_rss, $p Replace With: global $doing_rss, $p, $page_id, $pagename, Find: if (($p != &#039;&#039;)){ $p = intval($p); $article_id = $p; } Replace with: if (($p != &#039;&#039;)){ $p = intval($p); $article_id = $p; }elseif (($page_id != &#039;&#039;)){ $page_id = intval($page_id); $article_id = $page_id; }elseif (($pagename != &#039;&#039;)){ $reqpage = get_page_by_path($pagename); if ( !empty($reqpage) ) $article_id = $reqpage->ID; } To add a list of all Pages that link to your site grouped by Website (excluding Google): Open “wp-stattraq/reporter/summary.php” Find: <?php echo PrintTimestamp();?> </div> <div id="queryTerms"> Before Add: <table id="referrersTable"> <thead> <tr> <th>#</th> <th>Referrer</th> <th>Pages</th> </tr> </thead> <tfoot> <tr> <th>#</th> <th>Referrer</th> <th>Pages</th> </tr> </tfoot> <tbody> <?php if($results){ $i=0; foreach($results as $row){ preg_match(&#039;/(http.*?\:\/\/.*?)(\/.*)/&#039;, htmlentities($row->ref), $matches); $ref_array[$matches[1]][] = $matches[2]; } while( list($site, $pages) = @each($ref_array) ){ if(strpos($site,&#039;google&#039;) ==false && $site != &#039;&#039;){?> <tr class="<?php echo ($i % 2 == 0 ?
Read More ⟶

WordPress How To: Easily make an admin panel for a plugin

April 19, 2007 by aaron
I find the Admin panel the most tedious part of plugin development–even the slightest changes to the plugin requires major changes to the Admin panel, and it can be hard to remember every option you have in your plugin. However by following a few simple rules, your next Admin panel will be a breeze. Once you have the basic parts down, new options are just a cut and past away. One thing to note is that his Admin panel uses a few features that are best if repeated inside your plugin itself.
Read More ⟶

WordPress Access Keys Plugin

April 18, 2007 by aaron
The WordPress Access Keys Plugin a allows you to add access keys to pages and categories to improve accessibility of your WordPress website. This works with any page or category list that is called with wp_list pages and wp_list_categories respectively. This plugin works in all WordPRess versions from 2.1 – 2.5. Screenshot of Admin Panel: Demo: The About page on this site has an access key of 6 and the site map has an access key of 3.
Read More ⟶

A few WordPress Tricks.

April 9, 2007 by aaron
Just a few little tips for WordPress: If you don’t want the titles of posts to have the » character before them for SEO purposes just use: < ?php echo trim(wp_title('&raquo;',false), '&raquo; ');?> I was sick of my index.php being used to display pages, so I added the following to the top of my index.php to force WordPress to use single.php for all pages: < ?php if(is_page()){ include(&#039;single.php&#039;); exit; } ?> I wanted to be able to use javascript in some of my pages so I added the following to my header.php: <?php if(is_page()){ $j = get_post_meta($post->ID, &#039;header&#039;, true); if($j != &#039;&#039;){ echo $j; } } ?> Now anytime I need special style or javascript code added for a particular page I just add a custom field with the name header.
Read More ⟶

WordPress Meta Tag/SEO plugin

April 7, 2007 by aaron
I was sick of having a half dozen different plugins to add meta tags and fix the robots, so I wrote a plugin that prevents duplicate content from being indexed by Google, adds useful meta tags, and ensures that all posts are at one single permalink (using 301 redirects of course). This is more a shell of a plugin than an actual plugin as there are no options, and there are obvious flaws such as it doesn’t allow you to use paged posts.
Read More ⟶

Future Posts Calendar Plugin

April 7, 2007 by aaron
I use the future posts a lot. In fact, this post you are reading now was written almost a week before it was posted –actually I used this plugin to post about this plugin, but that is getting off topic. Anyway, if you use future posts a lot also you probably find yourself looking back and forth from your post list to a calendar or recording your future posts on a calendar to avoid having a double post on a single day and then none for three days.
Read More ⟶