Hello Everybody, i'm know very little about PHP but i've been reading every usefull tutorial i've seen.
Now im getting this error:
Parse error: syntax error, unexpected T_STRING in /home/location/domain.com/folder/xxx/xxx/functions.php on line 46
I've found several threads similar to mine but I can't find what is actually wrong, so i'll be really glad if you could help me find and solve it.
Heres the file:
<?php
/**
* xxxxxxxxxxxxxxxxxxxxxxx
* Do not modify this file unless it's
* below the noted comment section
*
* @xxxxxxxxxxx
* @xxxxxxxxxxx
* @copyright 2011
* @xxxxxxxxxxx
*
*/
// error reporting options
//error_reporting(0);
//$wpdb->show_errors();
//$wpdb->hide_errors();
// load ClassiPress theme functions
require_once (TEMPLATEPATH . '/includes/theme-functions.php');
/**
* add any of your custom functions below this section
*/
////////////////////////////// Build my custom drop down menu ///////////////////////////////////
if (!function_exists('my_menu_drop_down')) {
function my_menu_drop_down($my_taxonomy, $hierarchy, $hidempty, $cols = 3, $subs = 0) {
global $wpdb;
global $my_menu;
// get any existing copy of our transient data
if (false === ($my_menu = get_transient('my_menu'))) {
// put all options into vars so we don't have to waste resources by calling them each time from within the loops
$cp_cat_parent_count = get_option('cp_cat_parent_count');
$cp_cat_child_count = get_option('cp_cat_child_count');
$cp_cat_hide_empty = get_option('cp_cat_hide_empty');
$cp_cat_orderby = get_option('cp_cat_orderby');
// get all cats for the taxonomy
$my_menu_terms = get_terms($my_taxonomy, 'hide_empty='.$hidempty.'&hierarchical='.$hierarch y.'&pad_counts=1&show_count=true&orderby=name&orde r=ASC');
//remove all sub cats from the array
foreach ($my_menu_terms as $key => $value)
if ($value->parent != 0) unset($my_menu_terms[$key]);
$i = 0;
$menu_cols = $cols; // change this to add/remove columns
$total_main_parent_cats = count($my_menu_terms); // total number of parent cats
$items_per_col = round($total_main_parent_cats / $menu_cols); // items per column
// loop through all the sub
foreach($my_menu_terms as $my_term) :
if (($i == 0) || ($i == $items_per_col) || ($i == ($items_per_col * 2)) || ($i == ($items_per_col * 3)) ) {
if ($i == 0) $first = ' first';
$my_menu .= '<div class="catcol '. $first .'">';
}
// only show the total count if option is set
if($cp_cat_parent_count == 1)
$show_count = '('. $my_term->count .')';
$my_menu .= '<ul>';
$my_menu .= '<li class="maincat cat-item-'. $my_term->term_id .'"><a href="'. get_term_link($my_term, $my_taxonomy) .'" title="'. esc_attr($my_term->description) .'">'. $my_term->name .'</a> '.$show_count.'</li>';
// don't show any sub cats
if (is_taxonomy_hierarchical( $my_taxonomy )):
if($subs <> 999) :
// now get all the sub cats based off the parent cat id
$subcats = @wp_list_categories('orderby='.$cp_cat_orderby.'&t axonomy='.$my_taxonomy.'&order=asc&show_count='.$c p_cat_child_count.'&hierarchical=0&pad_counts=1&us e_desc_for_title=1&hide_empty=1&depth=1&title_li=& echo=0&number='.$subs.'&child_of='.$my_term->term_id.'&show_option_none='.get_option('cp_cat_s trip_nocatstext'));
// print out all the subcats for the current parent cat
$my_menu .= $subcats;
endif;
endif;
$my_menu .= '</ul>';
if (($i == ($items_per_col - 1)) || ($i == (($items_per_col * 2) - 1)) || ($i == (($items_per_col * 3) - 1)) || ($i == ($total_main_parent_cats - 1)))
$my_menu .= '</div><!-- /catcol -->';
$i++;
endforeach;
return $my_menu;
// set transient
set_transient('my_menu', $my_menu, get_option('cp_cache_expires'));
} else {
// must already be transient data so use that
return get_transient('my_menu');
}
}
}
///////////////////////////////////////////////////////////////////////////////////////////
////////////////////locations//////////////////////////////
add_action( 'init', 'create_locations' );
function create_locations() {
$labels = array(
'name' => _x( 'Ad Location', 'taxonomy general name' ),
'singular_name' => _x( 'Provincia', 'taxonomy singular name' ),
'search_items' => __( 'Buscar por Provincia' ),
'all_items' => __( 'Todas las Provincias' ),
'edit_item' => __( 'Editar Provincia' ),
'update_item' => __( 'Actualizar Provincia' ),
'add_new_item' => __( 'Añadir Nueva Ubicación' ),
'new_item_name' => __( 'Nombre de la Nueva Ubicación' ),
);
register_taxonomy('ad_location','ad_listing',array (
'hierarchical' => false,
'labels' => $labels
));
}
////////////////////////////////////////////////////////////
?>
Now, this one is "Line 46"
$my_menu_terms = get_terms($my_taxonomy, 'hide_empty='.$hidempty.'&hierarchical='.$hierarch y.'&pad_counts=1&show_count=true&orderby=name&orde r=ASC');
Can anyone help me please???