Blank html template – Transitional dtd

Posted: December 13th, 2009 | Author: jriggs | Filed under: web, wordpress | Tags: , , , , , | 1 Comment »
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 
<head>
 
<title>HTML Template</title>
 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<!--link type="text/css" rel="stylesheet" href="style.css"-->
 
</head>
 
<body>
 
</body>
</html>

Download zipped html file


Detect Adblock Users on a WordPress Blog

Posted: July 20th, 2009 | Author: jriggs | Filed under: wordpress | Tags: , | 6 Comments »

The following code allows you to display an alternate message for your advertisements to users who are using Adblock as well as most other modern online advertisement blocking applications.
adblockplus
In your blog’s root directory (folder containing the wp-addon, wp-content and wp-includes sub folders), create a file and name it “adframe.js”.

This name is crucial because most ad blockers will prevent files with this name from being accessed by the browser.  In the file you have just created insert the following code:

adblock = false;

Now go to where you have added the advertisements in your code.  For instance, if you’re running Google Ads, it would look something like this:

<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxxxxxx";

Just before “<script” add the following div tag:

<div class=”a”>

After the second “</script>” tag, add the closing div tag “</div>”

The last thing to do is add the javascript logic that decides if we should display the alternate message.  Add this just before the closing body “</body>” tag:

<script type="text/javascript">
<!--
 var adblock = true;
//-->
</script>
<script type="text/javascript" src="http://<your-blog-domain>/blog/adframe.js"></script>
<script type="text/javascript">
<!--
 if(adblock) {
 var allElements = document.getElementsByTagName('div');
 for (var i = 0; i < allElements.length; i++) {
 if (allElements[i].className == 'a') {
 allElements[i].innerHTML = 'Hello, you are blocking ads.';
 }
 }
 }
</script>

Be sure to replace “<your-blog-domain>” with your own as appropriate.

Users running ablocking software will see the following message ‘Hello, you are blocking ads’.  Of course you can substitute this message with anything you want, or even add some html.  I should note that this is a prickly issue with valid points for and against ‘blocking the blockers’.  I found an excellent example of the central arguement anonymous user “Headz” posted on another site.

>>It’s their connection. Their experience.

“You’re not entitled to your own person experience when visiting a website, anymore than when visiting a McDonald’s, or your local bank. If you walk into a McDonald’s, and there’s a huge annoying neon sign promoting some burger, you don’t have the right to tear it down to better accommodate your dining experience. It’s the restaurant owner’s prerogative to structure his business how he or she chooses, which may include big annoying signs. If you don’t like it, you have other dining options — Like the Burger King across the street.

If you don’t like that your favorite tech site is flooded with ads, then go somewhere else. You have other tech site options. It’s arrogant to think you have a right to tear someone’s business apart to better accommodate your personal experience. You wouldn’t do it at a McDonald’s, so I don’t understand how you feel justified doing it at a website.”

Of course, his argument fails to consider the differences between brick-and-mortars and electronic venues.  I’m not sure which side I’m on for this one, I’ve already flip-flopped twice.  Thanks to http://detect-ad-blocking-software.webconrad.com/ for the original code snippet.


Create Blank Page for WordPress Blog Using Your Theme Template

Posted: July 8th, 2009 | Author: jriggs | Filed under: php, wordpress | 9 Comments »

There may come a time when you need to create a blank page on your WordPress site that still uses your template’s header, footer and sidebar.  For example, if you incorporate your own custom search from google, you will need to specify a landing page where the search results will be displayed.

You could use WordPress to create a new page, but this has some problems.wordpress logo

  • WordPress tends to add code to the page the you don’t need or want
  • You will need to recreate this file whenever you switch themes or upgrade.
  • You cannot easily control where this file is created.

To avoid these problems we can use some built-in functions to display a blank page that uses your template and gives you greater control of the page’s content.

First, create a new file in the root directory of your blog.  Name it whatever makes sense to you but make sure to give it the ‘.php’ extension.  Copy the following into the file you have just created:

<?php
define('WP_USE_THEMES', false);
require('wp-blog-header.php');
get_header();
get_sidebar();
?>

<p>Hello!</p>

<?php
get_footer();
?>

You can see an example of this page here – http://joe-riggs.com/blog/blank.php.  You can add any valid html or javascript to the section between the php tags and will be displayed.  If you don’t want to display the header, sidebar or footer you can simply comment out or remove that particular line – ie : delete entire  “get_sidebar();” line to remove the sidebar.


My Google Page Rank is Increasing!

Posted: May 19th, 2009 | Author: jriggs | Filed under: wordpress | Tags: , , , , | 3 Comments »

Well happy days for me.  I have almost made it to the number 1 spot for the google query “joe riggs blog“, that pesky MMA fighter still holds the top rank, but I’m working on it!  There are a couple searches that are more specific where I come back as #1

  • joe riggs kentucky
  • riggs resume
  • send xml to Secured Server

Since I’m on the subject, I thought that I would share some tips that will help you increase your pagerank:

1) Content.  There’s no way around this, if you want google to rank your page, you need to give its robots something to rank.  The more content you have, the better off you are.  Along these lines, it helps to have dynamic titles that reflect the current page, this also helps people who are searching see relevent information, since google lists the page’s title as the url to your website.

2) Backlinks.  These are links to your page from pages outside of your website.  The kind you need are those that do NOT have the ‘nofollow’ attribute.  Nofollow tells the googlebot not to add these links to its index, you may have noticed your links in comments on wordpress and many other ‘social’ websites contains these type of links.

There are many free ways to get good backlinks.  Many forums and social sites such as facebook and digg allow you to post a link to your site.  Another way is to reach out to fellow content authors to see if they would be interested in trading backlinks.  To do this, you will need a links section on your own website.

3) Register.  All of the major search engines have provided a place for you to tell them about your site.  For example, here is google’s.   Google even has a webmaster application that will give more detailed information about how they ‘see’ your site, I highly recommend using it, plus it’s free.

Of course page ranking is a major business on the internet, and for many companies out there this is their specialization.  But, I find that these simple, honest techniques will help most small sites out there get some page-rank love too.

Edit:  I just hit #1 with this post (05/19/09)!  Wonder how long this will last..

joe riggs blog top query for 'joe riggs blog'

joe riggs blog top query for 'joe riggs blog'