
After reading this article, I modified and implemented it in this blog. You can see it in the right column.
This is how I did it.
1. Download and install Exec-Php. Then activate it.
2. Go to ‘Widgets’. Select ‘Text’ from the Widgets and add the following code.
Please note that I do not want to show ‘ | Okada Design Blog’ or ‘ « Okada Design Blog’ in the title.
Also I don’t want to show some pages including the index page, ‘(not set)’, ‘Okada Design Blog’, ‘Downloads | Okada Design Blog’ and ‘Downloads « Okada Design Blog’
So you need to adjust it accordingly for your situations.
<?php
$start = date('Y-m-d', (time() - (60 * 60 * 24 * 30)));
$end = date('Y-m-d');
$showpages = 10;
$thispage = 1;
$login = new GADWidgetData();
$ga = new GALib($login->auth_token, $login->account_id, 60);
$pages = $ga->pages_for_date_period($start, $end);
echo "<ul>";
foreach($pages as $page) {
$url = $page['value'];
$title = $page['children']['value'];
$array = array('(not set)', 'Okada Design Blog', 'Downloads | Okada Design Blog', 'Downloads « Okada Design Blog');
// You need to add any words which you don't want to show in the list
if(!in_array($title, $array)){
$takeout = array(" | Okada Design Blog"," « Okada Design Blog");
// You need to add any words which you want to delete in the list
$newtitle = str_replace($takeout, "", $title);
echo '<li><a href="' . $url . '" rel="nofollow">' . $newtitle . '</a></li>';
$thispage++;
}
if($thispage > $showpages) break;
}
echo "</ul>";
?>
3. Use SyntaxHighlighter Evolved for writing php code in your posts.
If you write php code with <?php and ?>, then the code will be executed in the post.
For example,
This is with php code.
This is the Exec-PHP ‘Hello World’. I am writing php code in the post directly. It starts with <?php and ends with ?>. End of php.
However if you use SyntaxHighlighter Evolved, it will not be executed.
<?php echo "This is with php code.<br />"; echo "This is the Exec-PHP 'Hello World'. I am writing php code in the post directly. It starts with <?php and ends with ?>. End of php."; ?>
The credit goes to Rob Glazebrook and Alex.



















[...] Implementing ‘Show Your Google Analytics Top Content in WordPress’ [...]
[...] Un articol scris ieri de Radu pe CNet.ro, Google Analytics Dashboard pentru WordPress, mi-a adus aminte că, la un moment dat, am găsit un code snippets care se folosea de funcțiile pluginului respectiv pentru a afișa articolele populare. Un quick search prin History și am găsit sursa. [...]
[...] Implementing ‘Show Your Google Analytics Top Content in WordPress’ May 29th, 2011 | Category: Codeigniter, Kaimono Kago [...]
[...] Implementing ‘Show Your Google Analytics Top Content in WordPress’ [...]