Call Now 407.243.8420

Posts Tagged ‘web’

Display Top Posts in WordPress with Google Analytics

Thursday, March 24th, 2011

In today’s tutorial we show you one way of displaying a list of the most popular posts in your WordPress template or sidebar. To do this you must first set up your site to use Google Analytics and make sure you’ve placed the code snippet in your theme’s footer.php. Next install the “Google Analytics Dashboard” plugin which can be found here:

http://wordpress.org/extend/plugins/google-analytics-dashboard/

We tested this with version 2.0.3 of the Google Analytics Dashboard wordpress plugin.

<?php
	// options
	$showposts = 3; // how many posts/pages to display?
	$days = 30; // how many days back to calculate?
 
	// do not edit below this line
	$thispost = 1;
	$start = date('Y-m-d', (time() - (60 * 60 * 24 * $days)));
	$end = date('Y-m-d');
	$login = new GADWidgetData(get_option('gad_auth_token'), get_option('gad_account_id'));
	$ga = new GALib('client', $login->auth_token, '', '', $login->account_id);
	$pages = $ga->pages_for_date_period($start, $end);
	echo "<ul>";
	foreach($pages as $page) {
		$url = $page['value'];
		$title = $page['children']['value'];
		// ignore these page titles
		$ignore = array(
			'(not set)',
			'Page Title 1',
			'Page Title 2'
		);
		if(!in_array($title, $ignore)){
			// list any strings you would like to remove from the titles
			$remove = array(
				" | Company Name",
				" « Company Name"
			);
			$newtitle = str_replace($remove, "", $title);
			echo '<li><a href="' . $url . '" rel="nofollow">' . $newtitle . '</a></li>';
			$thispost++;
		}
		if($thispost > $showposts) break;
	}
	echo "</ul>";
?>

Semantics

Monday, July 26th, 2010

Smashing Magazine posted a great article on Practicing Semantics.

Web Applications vs. Desktop/Mobile Applications

Sunday, April 18th, 2010

Web Applications vs. Desktop/Mobile Applications

Cross Browser CSS Gradient

Saturday, April 17th, 2010

Web Designer Wall has written a great tutorial on Cross Browser CSS Gradient

CSS Specificity and Inheritance

Saturday, April 17th, 2010

The folks over at Smashing Magazine have posted a great article on CSS Specificity and Inheritance, a must read for anyone working with CSS in our opinion. Check it out and let us know what you think!

Factors to Consider When Choosing a Web Host

Saturday, April 17th, 2010

Hong Kiat offers us 10 Important Factors to Consider When Choosing a Web Host Provider.

Google's Chrome browser passes HTML5 tests

Tuesday, April 13th, 2010

Google’s Chrome browser passes HTML5 test with flying colors http://bit.ly/bSSUk0

Let's Trade Blog Comments or Links

Tuesday, April 13th, 2010

Do you have a website? Let’s trade blog comments, website reviews or links between our sites.

Getting Things Done Like A Zen Master

Tuesday, April 13th, 2010

Getting Things Done Like a Zen Master

The Holistic Web

Monday, April 12th, 2010

The Holistic Web at Smashing Magazine is a great article outlining future trends of the web.