Arkadaşlar elimde AtoZ Category List adında bir eklenti var wordpress yazılar kategorisindeki tüm kategorileri a dan z ye listeleyerek size güzel bir index sağlıyor buraya kadar herşey çok güzel.
benim yapmak istediğim ise GeoTheme temasının özel place kategorisi var ordaki kategorileri çekerek bu kategorileri a dan z ye sıralamak onuda hallettim eklentinin kodlarından çalıştı da sıraladı kategorileri ama yazılar kategorisinde sıraladığı kategorilerin linkleri çalışıyordu bunda çalışmıyor çalışmıyor değil link vermiyo place kategoriyi görüyo ama link yok bu konuda bana yardımcı olacak var mı acaba?
Düzenleme yaptığım kodlar aşağıdadır.
include "../../../wp-load.php";
global $wpdb;
global $table_prefix;
require_once(ABSPATH .'wp-includes/pluggable.php');
$nonce=$_GET['_ajax_nonce'];
if (! wp_verify_nonce($nonce, 'a-to-z-category-listing-ajax') ) die("Security check");
?>
/*
$csql_rec = mysql_query("select * from ".$table_prefix."terms where name='Conditions'");
$csql_res = mysql_fetch_assoc($csql_rec);
$init_letter = $_GET['R'];
$sql = "select * from ".$table_prefix."terms wpt,".$table_prefix."term_taxonomy wptt where wpt.name like '$init_letter%' and wptt.parent = '$csql_res[term_id]' and wptt.taxonomy = 'category' and wpt.term_id = wptt.term_id";
$sql_rec = mysql_query($sql);
if(mysql_num_rows($sql_rec) > 0)
{
*/
global $wpdb;
$cat_id_qry = "SELECT cat_id from ".$wpdb->prefix."category_ids";
$rec = mysql_query($cat_id_qry);
$list = array();
while($res = mysql_fetch_assoc($rec))
{
$list[] = $res['cat_id'];
}
//print_r($list);
$lists = implode(",",$list);
if(count($list)>0)
{
$csql_rec = $wpdb->get_results("select * from ".$table_prefix."terms where name='Conditions'");
$init_letter = $_GET['R'];
$sql_rec = $wpdb->get_results("select * from ".$table_prefix."terms wpt,".$table_prefix."term_taxonomy wptt where wpt.name like '".$init_letter."%' and wptt.taxonomy = 'placecategory' and wpt.term_id = wptt.term_id and wpt.term_id not in(".$lists.")");
}
else
{
$csql_rec = $wpdb->get_results("select * from ".$table_prefix."terms where name='Conditions'");
$init_letter = $_GET['R'];
$sql_rec = $wpdb->get_results("select * from ".$table_prefix."terms wpt,".$table_prefix."term_taxonomy wptt where wpt.name like '".$init_letter."%' and wptt.taxonomy = 'placecategory' and wpt.term_id = wptt.term_id");
}
//echo "select * from ".$table_prefix."terms wpt,".$table_prefix."term_taxonomy wptt where wpt.name like '".$init_letter."%' and wptt.taxonomy = 'category' and wpt.term_id = wptt.term_id and wpt.term_id not in(".$lists.")";
//$sql_rec = $wpdb->get_results($sql);
if(count($sql_rec) > 0)
{
foreach($sql_rec as $c_rec){
$ttid = $c_rec->term_taxonomy_id;
$tid = $c_rec->term_id;
$name = $c_rec->name;
$description = $c_rec->description;
$cat_link = $c_rec->term_id;
?>
if(get_option('atoz_listing_style') == 'tabular')
{
?>
#tag = get_terms('category',array('parent'=>60, 'hide_empty' => false ));
echo "".$name."";
?>
echo $description;
?>
query_posts('cat='.$tid.'&showposts=7');
while (have_posts()) : the_post();
//echo $post->ID.' hjhjjhj';
endwhile;
?>
/*$psql = "select * from ".$table_prefix."posts wpp,".$table_prefix."term_relationships wpr where wpr.term_taxonomy_id = '$ttid' and wpr.object_id = wpp.ID and wpp.post_status = 'publish' and wpp.post_type = 'post'";*/
#echo $psql;
$psql_rec = $wpdb->get_results("select * from ".$table_prefix."posts wpp,".$table_prefix."term_relationships wpr where wpr.term_taxonomy_id = '$ttid' and wpr.object_id = wpp.ID and wpp.post_status = 'publish' and wpp.post_type = 'post'");
$i=1;
$pcontent='';
foreach($psql_rec as $psql_res){
$aid = $psql_res->ID;
$post_heading = $psql_res->post_title;
?>
$pcontent .= ' ';
$line_div .= ' ';
$i++;
?>
}
?>
}
if(get_option('atoz_listing_style') == 'listing')
{
?>
#tag = get_terms('category',array('parent'=>60, 'hide_empty' => false ));
echo "".$name."";
?>
echo $description;
?>
query_posts('cat='.$tid.'&showposts=7');
while (have_posts()) : the_post();
//echo $post->ID.' hjhjjhj';
endwhile;
?>
/*$psql = "select ID,post_title from ".$table_prefix."posts wpp,".$table_prefix."term_relationships wpr where wpr.term_taxonomy_id = '$ttid' and wpr.object_id = wpp.ID and wpp.post_status = 'publish' and wpp.post_type = 'post'";*/
#echo $psql;
$psql_rec = $wpdb->get_results("select ID,post_title from ".$table_prefix."posts wpp,".$table_prefix."term_relationships wpr where wpr.term_taxonomy_id = '$ttid' and wpr.object_id = wpp.ID and wpp.post_status = 'publish' and wpp.post_type = 'post'");
$i=1;
$pcontent='';
foreach($psql_rec as $psql_res){
$aid = $psql_res->ID;
$post_heading = $psql_res->post_title;
?>
$i++;
?>
}
?>
}
?>
}
}
else
{
?>
}
?>
ben aşağıdaki belirttiğim satırların 'placecategory' yazan yeri değiştirdim eskiden 'category' di
$sql_rec = $wpdb->get_results("select * from ".$table_prefix."terms wpt,".$table_prefix."term_taxonomy wptt where wpt.name like '".$init_letter."%' and wptt.taxonomy = 'placecategory' and wpt.term_id = wptt.term_id and wpt.term_id not in(".$lists.")");
linklerin tahmin ettiğim değiştirilecek yer aşağıda ama ne denediysem yapamadım
#tag = get_terms('category',array('parent'=>60, 'hide_empty' => false ));
echo "".$name."";
?>
bana bu konuda yardım ederseniz yada bi öneriniz olursa çok sevinirim iyi çalışmalar..