<[COLOR=#ff0000]ul[/COLOR] class="[COLOR=#0000cd]sort-posts[/COLOR]">
<[COLOR=#ff0000]p[/COLOR] class="[COLOR=#0000cd]title2[/COLOR]">Search post titles by Alpahbet :-
<?php
$arry = array(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z);
foreach ( $arry as $arrypost )
{
?>
<a href="?sort=<?php echo $arrypost;?>" style="padding:3px"><?php echo $arrypost;?></a>
<?php
}
global $sort;
$sort= $_GET['sort'];
$category = get_category( get_query_var( 'cat' ) );
$cat_id = $category->cat_ID;
wp_set_post_terms();
global $wpdb;
$results = $wpdb->get_results(
"SELECT * FROM $wpdb->posts LEFT JOIN wp_term_relationships ON $wpdb->posts.ID = wp_term_relationships.object_id WHERE post_title LIKE '$sort%' AND post_type = 'post' AND post_status = 'publish' AND term_taxonomy_id = '$cat_id';"
);
if (!empty($sort)){
if ( $results )
{?>
<u><h2><?php echo $sort;?></h2></u>
<?php foreach ( $results as $post )
{
setup_postdata ( $post );
?></[COLOR=#ff0000]p[/COLOR]>
<li style="list-style:none">
<a href="<?php the_permalink();?>"><?php the_title();?></a>
</li>
<?php
}
}
else
{
?>
<div class="[COLOR=#0000cd]alert[/COLOR]">No title Found with letter: <?php echo $sort;?></div>
<?php
}
}
else{
?>
</[COLOR=#ff0000]ul[/COLOR]>
<[COLOR=#800000]div[/COLOR]>
[COLOR=#008000] <!-- Default content CODE of your Category Php -->[/COLOR]
</[COLOR=#800000]div[/COLOR]>
<?php } ?>
http://test2013.hostoi.com/category/pc/
http://test2013.hostoi.com/[COLOR=#0000cd]pc/wj/[/COLOR]
http://test2013.hostoi.com/[COLOR=#0000cd][U]category[/U]/pc/[/COLOR]?sort=w
Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.
Contact us