Forum Replies Created
-
AuthorPosts
-
alfozaieParticipant
Hello Christopher, the problem you’re experiencing is due to breadcrumbs, you need to disable breadcrumbs on your website in order for these features to work, don’t worry they’re useless. Please back up your server before you proceed.
In order to disable breadcrumbs you need to edit your “theme-functions.php” located under:
/home/ssicommunity/saltspringexchange.com/wp-content/themes/classipress/includes/theme-functions.php
then what you need to do is remove this from it:
// Breadcrumb for the top of pages
function cp_breadcrumb() {
global $app_abbr, $post;$delimiter = ‘»’;
$currentBefore = ”;
$currentAfter = ”;if ( !is_home() || !is_front_page() || is_paged() ) :
$flag = 1;
echo ”;
echo ‘‘ . __(‘Home’, ‘appthemes’) . ‘ ‘ . $delimiter . ‘ ‘;// figure out what to display
switch ($flag) :case is_tax(APP_TAX_TAG):
echo $currentBefore . __(‘Ads tagged with’, ‘appthemes’) .’ '’ . single_tag_title(”, false) . ‘'’ . $currentAfter;
break;case is_tax():
// get the current ad category
$term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) );
// get the current ad category parent id
$parent = $term->parent;
// WP doesn’t have a function to grab the top-level term id so we need to
// climb up the tree and create a list of all the ad cat parents
while ($parent):
$parents[] = $parent;
$new_parent = get_term_by( ‘id’, $parent, get_query_var( ‘taxonomy’ ));
$parent = $new_parent->parent;
endwhile;// if parents are found display them
if(!empty($parents)):
// flip the array over so we can print out descending
$parents = array_reverse($parents);
// for each parent, create a breadcrumb item
foreach ($parents as $parent):
$item = get_term_by( ‘id’, $parent, get_query_var( ‘taxonomy’ ));
$url = get_term_link( $item->slug, APP_TAX_CAT );
echo ‘‘.$item->name.’ ‘ . $delimiter . ‘ ‘;
endforeach;
endif;
echo $currentBefore . $term->name . $currentAfter;
break;case is_singular(APP_POST_TYPE):
// get the ad category array
$term = wp_get_object_terms($post->ID, APP_TAX_CAT);
if(!empty($term)):
// get the first ad category parent id
$parent = $term[0]->parent;
// get the first ad category id and put into array
$parents[] = $term[0]->term_id;
// WP doesn’t have a function to grab the top-level term id so we need to
// climb up the tree and create a list of all the ad cat parents
while ($parent):
$parents[] = $parent;
$new_parent = get_term_by( ‘id’, $parent, APP_TAX_CAT );
$parent = $new_parent->parent;
endwhile;
// if parents are found display them
if(!empty($parents)):
// flip the array over so we can print out descending
$parents = array_reverse($parents);
// for each parent, create a breadcrumb item
foreach ($parents as $parent):
$item = get_term_by( ‘id’, $parent, APP_TAX_CAT );
$url = get_term_link( $item->slug, APP_TAX_CAT );echo ‘‘.$item->name.’ ‘ . $delimiter . ‘ ‘;
endforeach;
endif;
endif;
echo $currentBefore . the_title() . $currentAfter;
break;case is_single():
$cat = get_the_category();
$cat = $cat[0];
echo get_category_parents($cat, TRUE, ” $delimiter “);
echo $currentBefore . the_title() . $currentAfter;
break;case is_category():
global $wp_query;
$cat_obj = $wp_query->get_queried_object();
$thisCat = $cat_obj->term_id;
$thisCat = get_category($thisCat);
$parentCat = get_category($thisCat->parent);
if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ‘ ‘ . $delimiter . ‘ ‘));
echo $currentBefore . single_cat_title() . $currentAfter;
break;case is_page():
// get the parent page id
$parent_id = $post->post_parent;
$breadcrumbs = array();
if ($parent_id > 0 ) :
// now loop through and put all parent pages found above current one in array
while ($parent_id) {
$page = get_page($parent_id);
$breadcrumbs[] = ‘ID) . ‘”>’ . get_the_title($page->ID) . ‘‘;
$parent_id = $page->post_parent;
}
$breadcrumbs = array_reverse($breadcrumbs);
foreach ($breadcrumbs as $crumb) echo $crumb . ‘ ‘ . $delimiter . ‘ ‘;
endif;
echo $currentBefore . the_title() . $currentAfter;
break;case is_search():
echo $currentBefore . __(‘Search results for’, ‘appthemes’) .’ '’ . get_search_query() . ‘'’ . $currentAfter;
break;case is_tag():
echo $currentBefore . __(‘Posts tagged with’, ‘appthemes’) .’ '’ . single_tag_title(”, false) . ‘'’ . $currentAfter;
break;case is_author():
global $author;
$userdata = get_userdata($author);
echo $currentBefore . __(‘About’, ‘appthemes’) .’ ‘ . $userdata->display_name . $currentAfter;
break;case is_day():
echo ‘‘ . get_the_time(‘Y’) . ‘ ‘ . $delimiter . ‘ ‘;
echo ‘‘ . get_the_time(‘F’) . ‘ ‘ . $delimiter . ‘ ‘;
echo $currentBefore . get_the_time(‘d’) . $currentAfter;
break;case is_month():
echo ‘‘ . get_the_time(‘Y’) . ‘ ‘ . $delimiter . ‘ ‘;
echo $currentBefore . get_the_time(‘F’) . $currentAfter;
break;case is_year():
echo $currentBefore . get_the_time(‘Y’) . $currentAfter;
break;case is_archive():
if( !empty($_GET[‘sort’]) && $_GET[‘sort’] == ‘random’ )
echo $currentBefore . __(‘Random Ads’, ‘appthemes’) . $currentAfter;
elseif( !empty($_GET[‘sort’]) && $_GET[‘sort’] == ‘popular’ )
echo $currentBefore . __(‘Popular Ads’, ‘appthemes’) . $currentAfter;
else
echo $currentBefore . __(‘Latest Ads’, ‘appthemes’) . $currentAfter;
break;case is_404():
echo $currentBefore . __(‘Page not found’, ‘appthemes’) . $currentAfter;
break;endswitch;
if ( get_query_var(‘paged’) ) {
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() || is_archive() || is_tax() ) echo ‘ (‘;
echo __(‘Page’, ‘appthemes’) . ‘ ‘ . get_query_var(‘paged’);
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() || is_archive() || is_tax() ) echo ‘)’;
}echo ”;
endif;
}
Save it and you should be up and running in seconds.
Please note that if misdone the previous steps could break your website proceed with caution. Backup, Backup, backup.Abdullateef ALFozaie
BAS. Electrical Engineering Suny Buffalo
BS. Biomedical Sciences Suny Buffalo
MD. Candidate Vita-Salute San Raffaele University Milan -
AuthorPosts