Hello again and thank you Tbaxter for your help…. but it doesn’t work…
I’ve created a static page named “indices.php” with the same template as the index.php from my current theme and pasted your code on it, as this:
<?php
/*
Template Name: Indice
*/
?>
<?php get_header(); ?>
<div id=”outerColumnContainer”>
<div id=”innerColumnContainer”>
<div id=”leftColumn”>
<div class=”inside”>
<?php get_sidebar(); ?>
<div id=”contentColumn”>
<div class=”inside”>
<!– middle column content begin –>
<pre>
‘<div id=”content”>
‘ <?php
‘ $posts_per_page = ‘-1’;
‘ $defaultorderby = ‘category’;
‘ $defaultorder = ‘ASC’;
‘ define(‘NL’, “\n”);
‘ function archive_header($before=”, $after=”) {
‘ global $post, $orderby, $month, $previous, $siteurl, $blogfilename, $archiveheadstart, $archiveheadend, $category_name;
‘ $orderby = explode(‘ ‘, $orderby);
‘ $orderby = $orderby[0];
‘ if (‘category’ == $orderby) {
‘ $thiscategory = $category_name;
‘ if ($thiscategory != $previous) {
‘ $output .= ”.get_catname($thiscategory).”;
}
‘ $previous = $thiscategory;
‘ }
‘ if (!empty($output)) {
‘ $output = $before.$output.$after.NL;
‘ echo $output;
‘ }
‘ }
‘ function archive_date($format=’Y-m-d H:i:s’) {
‘ global $post;
‘ echo mysql2date($format, $post->post_date);
‘ }
‘ //Make sure categories get parsed out, they are deprecated in wp-blog-header.php
‘ global $author, $m;
‘ $orderby = ‘category’;
‘ if ($_POST[“order”] == ”) $order = “DESC”;
‘ else $order = $_POST[“order”];
‘ $year = ” . intval($_POST[“m”]);
‘ $m = $year;
‘ if (!empty($year)) $where .= ‘ AND YEAR(post_date)=’ . $year;
‘ if (!empty($whichauthor)) $where .= $whichauthor;
‘ $dogs = $wpdb->get_results(“SELECT * FROM $tablecategories WHERE 1=1 ORDER BY cat_name $order”);
‘ foreach ($dogs as $catt) {
‘ $categories = $wpdb->get_results(“SELECT * FROM $tablepost2cat WHERE category_id = $catt->cat_ID”);
‘ if ($categories) {
‘ echo ‘<div class=”storycontent”>’;
‘ foreach ($categories as $post2category) {
‘ $posts = $wpdb->get_results(“SELECT * FROM $tableposts WHERE $post2category->post_id = ID”.$where);
‘ global $category_name;
‘ $category_name = $post2category->category_id;
‘ if ($posts) {
‘ foreach ($posts as $post) {
‘ start_wp();
‘ archive_header(‘<h4>’, ‘</h4>
‘);
‘ ?>
* ‘ ID) ?>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”><?php the_title(); ?> ‘<cite>(<?php archive_date(‘m-d-Y’) ?>)</cite>
‘ <?php
‘ }
‘ }
‘ }
‘ echo ‘
‘;
‘ echo ‘</div>’;
‘ }
‘ }
‘?>
‘ <!–end content –></div>'</pre>
<!– middle column content end –>
</div>
</div>
<div class=”clear mozclear”></div>
</div>
</div>
<div id=”footer” class=”inside”>
<?php get_footer(); ?>
But when I load the page all I get is the following error:
“Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/wordpress/wp-content/themes/computer age/indices.php on line 27”
Anyone could tell us what’s going wrong?
Thank you