Show only parent category in Wordpress - php

I created list of category and sub category to display in my front page. When try to display all my category and subcategory are listing. I want only my main category to list. If anyone can help in this issue. Thank you
<span class="ad-category">
<?php
$category = get_the_category();
if ($category[0]->category_parent == 0) {
$tag = $category[0]->cat_ID;
$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
if (isset($tag_extra_fields[$tag])) {
$category_icon_code = $tag_extra_fields[$tag]['category_icon_code'];
$category_icon_color = $tag_extra_fields[$tag]['category_icon_color'];
}
} else {
$tag = $category[0]->category_parent;
$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
if (isset($tag_extra_fields[$tag])) {
$category_icon_code = $tag_extra_fields[$tag]['category_icon_code'];
$category_icon_color = $tag_extra_fields[$tag]['category_icon_color'];
}
}
if(!empty($category_icon_code)) {
?>
<div class="category-icon-box" style="background-color: <?php echo $category_icon_color; ?>;"><?php $category_icon = stripslashes($category_icon_code); echo $category_icon; ?></div>
<?php
}
$category_icon_code = "";
?>
</span>

Try This
<span class="ad-category">
<?php
$category = get_the_category();
if ($category[0]->category_parent == 1) {
$tag = $category[0]->category_parent;
$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
if (isset($tag_extra_fields[$tag])) {
$category_icon_code = $tag_extra_fields[$tag]['category_icon_code'];
$category_icon_color = $tag_extra_fields[$tag]['category_icon_color'];
}
}
if(!empty($category_icon_code)) {
?>
<div class="category-icon-box" style="background-color: <?php echo $category_icon_color; ?>;"><?php $category_icon = stripslashes($category_icon_code); echo $category_icon; ?></div>
<?php
}
$category_icon_code = "";
?>
</span>

Related

Get ACF fields of taxonomy in foreach loop

I have created a function that allows me to display the next/previous category, by order of their position. This is working fine, the problem I am having is getting ACF fields to display specific to each category.
I currently have a colour picker ACF field for every category - which is different for each one, this is set to display on each link. At the moment, the ACF field is only bringing in the hex value from the current category that is being viewed, as opposed to the next/previous ones.
function next_prev_cat() {
$this_taxonomy = get_queried_object();
if (is_category()) {
$taxonomies = get_categories();
}
if (is_tag()) {
$taxonomies = get_tags();
}
foreach ($taxonomies as $position => $tax):
if ($this_taxonomy->term_id == $tax->term_id):
$next_tax = $position + 1;
$prev_tax = $position - 1;
break;
endif;
endforeach;
$showPrev;
$showNext;
if ($prev_tax < 0) {
$prev_tax=count($taxonomies) - 1;
$showPrev='';
} else {
$prev_tax;
$showPrev = $taxonomies[$prev_tax]->name;
}
if ($prev_tax == count($taxonomies)-2) {
$next_tax = 0;
$showNext = '';
} else {
$showNext = $taxonomies[$next_tax]->name;
}
$prevLink = get_term_link( $taxonomies[$prev_tax] );
$nextLink = get_term_link( $taxonomies[$next_tax] );
?>
<div class="area-links">
<a style="border:1px solid <?php the_field('brand_colour', $tax); ?>" href="<?php echo $prevLink;?>"><?php echo $showPrev; ?></a>
<a style="border:1px solid <?php the_field('brand_colour', $tax); ?>"href="<?php echo $nextLink;?>"><?php echo $showNext ?></a>
</div>
<?php
}
Here is updated version of code
function next_prev_cat() {
$this_taxonomy = get_queried_object();
$id_for_color=false;
if (is_category()) {
$taxonomies = get_categories();
}
if (is_tag()) {
$taxonomies = get_tags();
}
$colors=array();
foreach ($taxonomies as $position => $tax):
$id_for_color=$tax->term_id;
$colors[$id_for_color]=get_field('brand_colour', $id_for_color);
$cats=array_push($cats,$id_for_color );
if ($this_taxonomy->term_id == $tax->term_id):
$next_tax = $position + 1;
$prev_tax = $position - 1;
break;
endif;
endforeach;
$showPrev;
$showNext;
if ($prev_tax < 0) {
$prev_tax=count($taxonomies) - 1;
$showPrev='';
} else {
$prev_tax;
$prev_color=$colors[$taxonomies[$prev_tax]->term_id];
$showPrev = $taxonomies[$prev_tax]->name;
}
if ($prev_tax == count($taxonomies)-2) {
$next_tax = 0;
$showNext = '';
} else {
$next_color=$colors[$taxonomies[$next_tax]->term_id];
$showNext = $taxonomies[$next_tax]->name;
}
$prevLink = get_term_link( $taxonomies[$prev_tax] );
$nextLink = get_term_link( $taxonomies[$next_tax] );
?>
<div class="area-links">
<a style="border:1px solid <?php echo $prev_color; ?>" href="<?php echo $prevLink;?>"><?php echo $showPrev; ?></a>
<a style="border:1px solid <?php echo $next_color; ?>"href="<?php echo $nextLink;?>"><?php echo $showNext ?></a>
</div>
<?php}

Exclude specific taxonomy from query

i have a problem, in first this is my code
$page_id = get_queried_object_id();
$post = get_post($page_id);
$filter_args = array(
'tax_query'=>array(),
'meta_query'=>array()
);
$posts_per_page = 5;
$args = array(
'posts_per_page' => $posts_per_page,
'post_type' => 'property',
'orderby' => 'date'
);
$args = array_merge($args, $filter_args);
$query = new WP_Query( $args );
$items = array();
if(count($query->posts) > 0){
$items = $query->posts;
}
$acf_fields = get_acf_fields(array('general_property_fields', 'property_price'));
foreach($items as $k=>$v){
$items[$k]->acf = get_acf_data($v->ID, $acf_fields);
$items[$k]->pc = sb_get_price($v->ID);
}
The get_acf_fields is a personal function, not worry in this question about that.
And this is my loop for get the values i want.
<?php foreach ($items as $v) {
$status = $v->acf['c_status'];
$status_name = get_term_by('id', $status, 'type');
?>
<?php if ($status_name) { ?>
<div class="sb-sidebar-featured-type">
<?php
$title_status = $status_name->name;
$status = explode(' ', $title_status);
?>
<div class="sidebar-featured-transaction"><?=($status_name) ? $status[0] : '';?></div>
</div>
<?php } ?>
All work fine, but the status give me all values from the taxonomy with name status, for example if i obtain "sold", "discount", "offer", i want to exlude the results with "sold" in the taxonomy but i dont know how make that, thanks :D
Will you please try like this:
<?php if ($status_name != 'sold') { ?>
<div class="sb-sidebar-featured-type">
<?php
$title_status = $status_name->name;
$status = explode(' ', $title_status);
?>
<div class="sidebar-featured-transaction"><?=($status_name) ? $status[0] : '';?></div>
</div>
<?php } ?>
Here is the code working for somelse
<?php foreach ($items as $v) {
$tax_type = $v->acf['c_type'];
$status = $v->acf['c_status'];
$type_name = get_term_by('id', $tax_type, 'type');
$status_name = get_term_by('id', $status, 'type');
if ($status_name) {
$check_status = trim($status_name->slug);
}
if ($check_status != 'sold' && $check_status != 'vendido') {
?>
<div class="sidebar-featured-cont">
<div class="sidebar-featured">
<a class="sidebar-featured-image" href="<?=get_permalink($v->ID)?>">
<img src="<?=$v->acf['c_gallery'][0]['sizes']['property-listing']?>" alt="" />
<?php if ($status_name) { ?>
<div class="sb-sidebar-featured-type">
<?php
$title_status = $status_name->name;
$status = explode(' ', $title_status);
?>
<div class="sidebar-featured-transaction"><?=($status_name) ? $status[0] : '';?></div>
</div>
<?php } ?>
</a>
<div class="sidebar-featured-title"><?=$v->post_title?></div>
<div class="sidebar-featured-price">$ <?=$v->pc?></div>
<div class="clearfix"></div>
</div>
</div>
<?php } ?>
<?php } ?>

Magento: How to get sub category of current category by level and so on

I have a following code that shows category by level, but I have to show all the sub categories from that specific category.
<?php
$_cat = new Mage_Catalog_Block_Navigation();
$currentCat = $_cat->getCurrentCategory();
$subCats = Mage::getModel('catalog/category')->load($currentCat->getId())- >getChildren();
$subCatIds = explode(',',$subCats);
?>
<?php ////////////////////////level-3///////////////////////////// ?>
<?php $category = Mage::registry('current_category');
$category->getParentCategories();
if ( $category->getLevel() == 3 ) : ?>
<div class="cat_drop_ser_wrap">
<?php $currentCat = Mage::getModel('catalog/category')->load($currentCat- >getId()) ?>
<select class="select_class" onchange="window.location.href=this.value">
<option value="#">-Select</option>
<?php foreach($subCatIds as $subCatId): ?>
<?php $subCat = Mage::getModel('catalog/category')->load($subCatId); ?>
<?php if($subCat->getIsActive()): ?>
<option value="<?php echo $subCat->getUrl() ?>">
<?php echo $subCat->getName(); ?>
</option>
<?php endif; ?>
<?php endforeach; ?>
</select>
</div>
<?php endif; ?><!--if--level-3-->
Thanks in advance.
Ok in case anyone needs it following will show the sub categories and so on:
<?php //////sub////// ?>
<?php
$category_levels = Mage::getModel('catalog/category')->load($category->getId());
$subcategories = $category_levels->getChildrenCategories();
if (count($subcategories) > 0){
foreach($subcategories as $subcategory){
$category_levels_two = Mage::getModel('catalog/category')->load($subcategory->getId());
$subcategoriess = $category_levels_two->getChildrenCategories();
if (count($subcategoriess) > 0){
$attribute = Mage::getSingleton('eav/config')->getAttribute('catalog_category', 'category_dropdown_label');
$text = $category_levels_two->getCategoryDropdownLabel();
echo '<div class="empty_serch_select_1 cat_drop_ser_wrap 2">';
echo '<label>' . $text . '</label>';
echo '<select disabled="disabled">';
echo '<option value="#">-Select</option>';
echo '<select>';
echo '</div>';
break;
}
}
}
?>
<?php //////sub-sub////// ?>
<?php
$category_levels = Mage::getModel('catalog/category')->load($category->getId());
$subcategories = $category_levels->getChildrenCategories();
echo '<div class="empty_serch_select_2 cat_drop_ser_wrap 3">';
if (count($subcategories) > 0){
foreach($subcategories as $subcategory){
$category_levels_two = Mage::getModel('catalog/category')->load($subcategory->getId());
$subcategoriess = $category_levels_two->getChildrenCategories();
if (count($subcategoriess) > 0){
foreach($subcategoriess as $subcategorys){
$category_levels_three = Mage::getModel('catalog/category')->load($subcategorys->getId());
$subcategoriesss = $category_levels_three->getChildrenCategories();
if (count($subcategoriesss) > 0){
$attribute = Mage::getSingleton('eav/config')->getAttribute('catalog_category', 'category_dropdown_label');
$text = $category_levels_three->getCategoryDropdownLabel();
echo '<label>' . $text . '</label>';
break;
}
}
}
}
}
echo '<select disabled="disabled">';
echo '<option value="#">-Select</option>';
echo '<select>';
echo '</div>';
?>
<?php //////sub-sub-sub////// ?>
<?php
$category_levels = Mage::getModel('catalog/category')->load($category->getId());
$subcategories = $category_levels->getChildrenCategories();
echo '<div class="empty_serch_select_2 cat_drop_ser_wrap 3">';
if (count($subcategories) > 0){
foreach($subcategories as $subcategory){
$category_levels_two = Mage::getModel('catalog/category')->load($subcategory->getId());
$subcategoriess = $category_levels_two->getChildrenCategories();
if (count($subcategoriess) > 0){
foreach($subcategoriess as $subcategorys){
$category_levels_three = Mage::getModel('catalog/category')->load($subcategorys->getId());
$subcategoriesss = $category_levels_three->getChildrenCategories();
if (count($subcategoriesss) > 0){
foreach($subcategoriesss as $subcategorys){
$category_levels_three = Mage::getModel('catalog/category')->load($subcategorys->getId());
$subcategoriessss = $category_levels_three->getChildrenCategories();
if (count($subcategoriessss) > 0){
$attribute = Mage::getSingleton('eav/config')->getAttribute('catalog_category', 'category_dropdown_label');
$text = $category_levels_three->getCategoryDropdownLabel();
echo '<label>' . $text . '</label>';
break;
}
}
}
}
}
}
}
echo '<select disabled="disabled">';
echo '<option value="#">-Select</option>';
echo '<select>';
echo '</div>';
?>

content/admin banner different language

I can add images to various languages in OpenCart 1.5.6 version, this is how much you probably know pavcontentslider, I have the opportunity to do different languages but not text and image .. if anyone can help me I would be grateful. Thank you
Printscreen: http://postimg.org/image/v6nrcebrf/
code admin interface:
<?php
class ControllerModulePavcontentslider extends Controller {
private $error = array();
public function index() {
$this->language->load('module/pavcontentslider');
$this->load->model('tool/image');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->request->post['pavcontentslider_module'][0]['banner_image'] = $this->request->post['banner_image'];
unset($this->request->post['banner_image']);
$this->model_setting_setting->editSetting('pavcontentslider', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->redirect($this->url->link('module/pavcontentslider', 'token=' . $this->session->data['token'], 'SSL'));
}
$this->data['heading_title'] = $this->language->get('heading_title');
$this->data['text_image_manager'] = $this->language->get('text_image_manager');
$this->data['text_browse'] = $this->language->get('text_browse');
$this->data['text_clear'] = $this->language->get('text_clear');
$this->data['text_enabled'] = $this->language->get('text_enabled');
$this->data['text_disabled'] = $this->language->get('text_disabled');
$this->data['text_content_top'] = $this->language->get('text_content_top');
$this->data['text_content_bottom'] = $this->language->get('text_content_bottom');
$this->data['text_column_left'] = $this->language->get('text_column_left');
$this->data['text_column_right'] = $this->language->get('text_column_right');
$this->data['entry_title'] = $this->language->get('entry_title');
$this->data['entry_width'] = $this->language->get('entry_width');
$this->data['entry_height'] = $this->language->get('entry_height');
$this->data['entry_description'] = $this->language->get('entry_description');
$this->data['entry_layout'] = $this->language->get('entry_layout');
$this->data['entry_position'] = $this->language->get('entry_position');
$this->data['entry_status'] = $this->language->get('entry_status');
$this->data['entry_sort_order'] = $this->language->get('entry_sort_order');
$this->data['button_save'] = $this->language->get('button_save');
$this->data['button_cancel'] = $this->language->get('button_cancel');
$this->data['button_add_module'] = $this->language->get('button_add_module');
$this->data['button_remove'] = $this->language->get('button_remove');
$this->data['no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
$this->data['entry_show_image'] = $this->language->get( 'entry_show_image' );
$this->data['entry_module_title'] = $this->language->get( 'entry_module_title' );
$this->data['tab_module'] = $this->language->get('tab_module_banner');
$this->data['entry_image_navigator'] = $this->language->get( 'entry_image_navigator' );
$this->data['entry_navigator_width'] = $this->language->get( 'entry_navigator_width' );
$this->data['entry_navigator_height'] = $this->language->get( 'entry_navigator_height' );
if (isset($this->error['warning'])) {
$this->data['error_warning'] = $this->error['warning'];
} else {
$this->data['error_warning'] = '';
}
$this->data['breadcrumbs'] = array();
$this->data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
'separator' => false
);
$this->data['breadcrumbs'][] = array(
'text' => $this->language->get('text_module'),
'href' => $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'),
'separator' => ' :: '
);
$this->data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('module/pavcontentslider', 'token=' . $this->session->data['token'], 'SSL'),
'separator' => ' :: '
);
$this->data['action'] = $this->url->link('module/pavcontentslider', 'token=' . $this->session->data['token'], 'SSL');
$this->data['cancel'] = $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL');
$this->data['token'] = $this->session->data['token'];
$this->data['modules'] = array();
$this->data['positions'] = array( 'mainmenu',
'slideshow',
'promotion',
'content_top',
'column_left',
'column_right',
'content_bottom',
'mass_bottom',
'footer_top',
'footer_center',
'footer_bottom'
);
$d = array('layout_id'=>'','position'=>'','status'=>'','sort_order'=>'1',
'banner_image'=>array(),'width'=>940,'height'=>350,
'image_navigator' => 0,
'navimg_height' =>97,
'navimg_weight' =>177,
'text_interval'=>8000
);
$this->data['effects'] = array('slideUp','slideDown','slideLeft',
'slideRight','slideExpandUp','expandUp','fadeIn',
'expandOpen','bigEntrance','hatch','bounce',
'pulse','floating','tossing','pullUp','pullDown','stretchLeft','stretchRight'
);
if (isset($this->request->post['pavcontentslider_module'])) {
$this->data['modules'] = $this->request->post['pavcontentslider_module'];
} elseif ($this->config->get('pavcontentslider_module')) {
$this->data['modules'] = $this->config->get('pavcontentslider_module');
}
if( !empty($this->data['modules']) ){
$d = array_merge($d,$this->data['modules'][0]);
}
$this->data['module'] = $d;
if( $d['banner_image'] ){
$tmp = array();$i=1;
foreach( $d['banner_image'] as $key => $banner ){
$banner['link'] = isset($banner['link'])?trim($banner['link']):"";
$banner['thumb'] = $this->model_tool_image->resize($banner['image'], 100, 100);
$tmp[$i++] = $banner;
}
$d['banner_image'] = $tmp;
}
$this->data['banner_image'] = $d['banner_image'];
$this->load->model('design/layout');
$this->data['layouts'][] = array('layout_id'=>99999, 'name' => $this->language->get('all_page') );
$this->data['layouts'] = array_merge($this->data['layouts'],$this->model_design_layout->getLayouts());
$this->load->model('localisation/language');
$this->data['languages'] = $this->model_localisation_language->getLanguages();
$this->document->addStyle('view/stylesheet/pavcontentslider.css');
$this->template = 'module/pavcontentslider.tpl';
$this->children = array(
'common/header',
'common/footer'
);
$this->response->setOutput($this->render());
}
public function typo(){
if (isset($this->request->get['field'])) {
$this->data['field'] = $this->request->get['field'];
} else {
$this->data['field'] = '';
}
$typoFile = HTTP_CATALOG."catalog/view/theme/default/stylesheet/pavcontentslider.css";
if( file_exists( DIR_CATALOG ."view/theme/". $this->config->get('config_template')."/stylesheet/pavcontentslider.css" ) ){
$typoFile = HTTP_CATALOG."catalog/view/theme/". $this->config->get('config_template')."/stylesheet/pavcontentslider.css";
}
$content = file_get_contents( $typoFile );
$this->data['typoFile'] = $typoFile;
$data = preg_match_all("#\.pav-caption\.([\w\-]+)\s*{\s*#", $content, $matches);
$this->data['captions'] = array();
if( isset($matches[1]) ){
$this->data['captions'] = $matches[1];
}
$this->template = 'module/pavcontentslider_typo.tpl';
$this->response->setOutput($this->render());
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'module/pavcontentslider')) {
$this->error['warning'] = $this->language->get('error_permission');
}
if( !isset($this->request->post['banner_image']) ){
$this->error['warning'] = $this->language->get('error_missing_banner');
}
if (!$this->error) {
return true;
} else {
return false;
}
}
}
?>
home interface:
<?php if( count($banners) ) { ?>
<?php $id = rand(1,10);?>
<div id="pavcontentslider<?php echo $id;?>" class="carousel slide pavcontentslider">
<div class="carousel-inner">
<?php foreach ($banners as $i => $banner) { ?>
<div class="item <?php if($i==0) {?>active<?php } ?>">
<?php if ($banner['link']) { ?>
<img src="<?php echo $banner['thumb']; ?>" alt="<?php echo $banner['title']; ?>" />
<?php } else { ?>
<img src="<?php echo $banner['thumb']; ?>" alt="<?php echo $banner['title']; ?>" />
<?php } ?>
<?php if( isset($banner['layers']) && $banner['layers'] ) { ?>
<?php foreach( $banner['layers'] as $layer ) { ?>
<div class="pav-caption <?php echo $layer['effect']. " ".$layer['class'];?>" style="top:<?php echo (int)$layer['top']?>px;left:<?php echo (int)$layer['left']?>px">
<?php echo $layer['caption'];?>
</div>
<?php } ?>
<?php } ?>
</div>
<?php } ?>
</div>
<?php if( count($banners) > 1 ){ ?>
<a class="carousel-control left " href="#pavcontentslider<?php echo $id;?>" data-slide="prev">‹</a>
<a class="carousel-control right" href="#pavcontentslider<?php echo $id;?>" data-slide="next">›</a>
<?php } ?>
<?php if( count($banners) > 1 ) { ?>
<?php if( isset($setting['image_navigator']) && $setting['image_navigator'] ) { ?>
<ol class="carousel-indicators thumb-indicators hidden-phone ">
<?php foreach ( $banners as $j=>$item ) : ?>
<li data-target="#pavcontentslider<?php echo $id;?>" data-slide-to="<?php echo $j;?>" class="<?php if($j==0) {?>active<?php } ?>">
<img src="<?php echo $item['image_navigator'];?>"/>
</li>
<?php endforeach ?>
</ol>
<?php } else { ?>
<ol class="carousel-indicators">
<?php foreach ( $banners as $j=>$item ) : ?>
<li data-target="#pavcontentslider<?php echo $id;?>" data-slide-to="<?php echo $j;?>" class="<?php if($j==0) {?>active<?php } ?>"></li>
<?php endforeach ?>
</ol>
<?php } ?>
<?php } ?>
</div>
<?php if( count($banners) > 1 ){ ?>
<script type="text/javascript">
<!--
$('#pavcontentslider<?php echo $id;?>').carousel({interval:8000});
-->
</script>
<?php } ?>
<?php } ?>

Replace &ct_= with %2c or comma

I've been wrestling with this function for far to long and I wish I had enough respect to offer a bounty. Help would be greatly appreciated.
// Advanced Search Check
function ct_search_form_check($name, $taxonomy_name = null) {
global $search_values;
if (!$taxonomy_name) {
$taxonomy_name = $name;
} ?>
<?php foreach( get_terms($taxonomy_name, 'hide_empty=0') as $t) : ?>
<?php if ($search_values[$name] == $t->slug) { $selected = 'checked="checked"'; } else { $selected = ''; } ?>
<div><input id="ct_<?php echo $name; ?>" name="ct_<?php echo $name; ?>" type="checkbox" style="margin-right:5px; margin-left:5px" <?php echo $selected; ?>value="<?php echo $t->slug; ?>"><?php echo $t->name; ?><span style="margin-left:10px"></span></input></div>
//recently added this part to replace duplicate taxonomy_name in url
<?php $data = array();
while (list($name, $t->slug) = each($arr)) {
$data[] = "$name";
}
echo implode($data); ?>
<?php endforeach; ?>
<?php
}
How do I change my output from
?ct_zipcode=&ct_event_type=alumni&ct_=anneverisy&ct_setting=ballroom&ct_=bar&Venue-search=true
to
?ct_zipcode=&ct_event_type=alumni%2canneverisy&ct_setting=ballroom%2cbar&Venue-search=true
This worked. hopefully it will help someone else
function ct_search_form_check($name, $taxonomy_name = null) {
global $search_values;
if (!$taxonomy_name) {
$taxonomy_name = $name;
} ?>
<input type="hidden" value="" name="ct_<?php echo $name; ?>" />
<?php foreach( get_terms($taxonomy_name, 'hide_empty=0') as $t) : ?>
<?php if ($search_values[$name] == $t->slug) { $selected = 'checked="checked"'; } else { $selected = ''; } ?>
<div><input id="ct_<?php echo $name; ?>" name="ct_<?php echo $name; ?>" type="checkbox" style="margin-right:5px; margin-left:5px" <?php echo $selected; ?>value="<?php echo $t->slug; ?>"><?php echo $t->name; ?><span style="margin-left:10px"></span></input></div>
<?php
$data = array();
while (list($name, $t->slug) = each($arr)) {
$data[] = "$name";
}
echo implode($data);
if (!empty($_GET['ct_'])) {
$url = str_replace('&ct_=', '%2c', $_SERVER['QUERY_STRING']);
header("Location: ?$url");
} ?>
<?php endforeach; ?>
<?php
}

Categories