How do I "highlight" (turn to a different color, make bold, whatever..) a link that has been clicked on?
Example is here: http://www.celebrything.com/ Trying to get the Today, Week, and Month links in the right sidebar to turn a different color once clicked.
Here's the code I'm using to show the results in the right sidebar:
<div id="sidebar">
<div class="post">
<h2>
<font color="#333333">Top 50 Celebrities</font>
<br>
<br>
<font color="#333333"><a href="index.php?table=today">Today</a></font>
<font color="#333333"><a href="index.php?table=week">Week</a></font>
<font color="#333333"><a href="index.php?table=month">Month</a></font>
</font>
<br>
<br>
<?php
function showTable ($table){
if (!in_array($table, array('today', 'week', 'month'))) {
return false;
}
global $wpdb;
$result = $wpdb->get_results('SELECT name, count FROM wp_celebcount_' . $table);
foreach($result as $row) {
echo '<a href="http://www.celebrything.com/?s=' .
urlencode($row->name) . '&search=Search">' . $row->name .
'</a> - ' . $row->count . ' Posts<br/>';
}
}
if (!empty($_GET['table'])) {
showTable($_GET['table']);
} else { showTable('today'); }
?>
</h2>
</div>
</div>
<div class="clear"></div>