yeah thats why i had to make my page with individual mysql queries for each letter.
so if there is not way to do this though WP how would i be able to do add a query for the other post tables and have it show.
this is my current code for making a index page, and i am definite there is a better way of doing this, i am just not that good in PHP looping to figure it out.
<?php
/*
Template Name: Movie Index
*/
?>
<?php get_header(); ?>
<div class="content">
<div id="primary-wrapper">
<div id="primary">
<div id="notices"></div>
<a name="startcontent" id="startcontent"></a>
<div id="current-content" class="hfeed">
<?php while (have_posts()): the_post(); ?>
<div id="post-<?php the_ID(); ?>" class="<?php k2_post_class(); ?>">
<div class="page-head">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title='<?php printf( __('Permanent Link to "%s"','k2_domain'), wp_specialchars(strip_tags(the_title('', '', false)),1) ); ?>'><?php the_title(); ?></a></h2>
<?php edit_post_link(__('Edit','k2_domain'), '<span class="entry-edit">','</span>'); ?>
</div>
<div class="entry-content">
<?php
mysql_select_db($DB_NAME);
$resultNUM = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND (post_title LIKE '1%' OR
post_title LIKE '2%' OR
post_title LIKE '3%' OR
post_title LIKE '4%' OR
post_title LIKE '5%' OR
post_title LIKE '6%' OR
post_title LIKE '7%' OR
post_title LIKE '8%' OR
post_title LIKE '9%')
ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>#</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultNUM )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
echo "<tr><td>";
$year = get_post_meta($post->ID, 'year', true);
echo $year;
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultA = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'A%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>A</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultA )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultB = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'B%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>B</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultB )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultC = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'C%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>C</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultC )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultD = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'D%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>D</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultD )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultE = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'E%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>E</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultE )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultF = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'F%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>F</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultF )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultG = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'G%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>G</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultG )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultH = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'H%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>H</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultH )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultI = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'I%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>I</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultI )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultJ = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'J%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>J</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultJ )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultK = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'K%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>K</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultK )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultL = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'L%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>L</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultL )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultM = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'M%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>M</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultM )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultN = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'N%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>N</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultN )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultO = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'O%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>O</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultO )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultP = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'P%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>P</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultP )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultQ = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'Q%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>Q</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultQ )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultR = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'R%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>R</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultR )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultS = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'S%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>S</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultS )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultT = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'T%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>T</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultT )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultU = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'U%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>U</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultU )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultV = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'V%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>V</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultV )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultW = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'W%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>W</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultW )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultX = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'X%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>X</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultX )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultY = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'Y%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>Y</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultY )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
<?php
mysql_select_db($DB_NAME);
$resultZ = mysql_query("SELECT * FROM posts
WHERE post_type='post' AND post_title LIKE 'Z%' ORDER BY post_title") or die(mysql_error());
echo "<table border='0'>";
echo "<tr> <th>Z</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultZ )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<a href='$row[guid]'target='_parent'>$row[post_title]</a>";
echo "</td><td>";
}
echo "</table>";
?>
</div>
</div> <!-- #post-ID -->
<?php endwhile; ?>
</div> <!-- #current-content -->
<div id="dynamic-content"></div>
</div> <!-- #primary -->
</div> <!-- #primary-wrapper -->
<?php get_sidebar(); ?>
</div> <!-- .content -->
<?php get_footer(); ?>