Results 1 to 7 of 7

Thread: Disabling/Removing Breadcrumb

  1. #1
    Thread Starter
    plivans's Avatar
    Join Date
    Nov 2012
    Location
    United States
    Posts
    170
    Thanks
    8
    Thanked 11 Times in 11 Posts

    Disabling/Removing Breadcrumb

    Can someone help me on removing the breadcrumb? Can I comment it out somehow or place some code in my childe theme's function.php file? I really don't want to have to delete it from the core file, but from what I've been told, it is what is breaking my Community Events Calendar. I've placed the code below in case that helps. It is located in the includes/theme-function.php

    PHP Code:
    // Breadcrumb for the top of pages
    function cp_breadcrumb() {
        global 
    $app_abbr$post;

        
    $delimiter '»';
        
    $currentBefore '<span class="current">';
        
    $currentAfter '</span>';

        if ( !
    is_home() || !is_front_page() || is_paged() ) :
            
    $flag 1;
            echo 
    '<div id="crumbs">';
            echo 
    '<a href="' get_bloginfo('url') . '">' __('Home''appthemes') . '</a> ' $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'$parentget_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'$parentget_query_var'taxonomy' ));
                            
    $url get_term_link$item->slugAPP_TAX_CAT );
                            echo 
    '<a href="'.$url.'">'.$item->name.'</a> ' $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->IDAPP_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'$parentAPP_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'$parentAPP_TAX_CAT );
                              
    $url get_term_link$item->slugAPP_TAX_CAT );

                              echo 
    '<a href="'.$url.'">'.$item->name.'</a> ' $delimiter ' ';
                          endforeach;
                      endif;
            endif;
                    echo 
    $currentBefore the_title() . $currentAfter;
                break;

                case 
    is_single():
                    
    $cat get_the_category();
                    
    $cat $cat[0];
                    echo 
    get_category_parents($catTRUE$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($parentCatTRUE' ' $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 ) :
                        
    // now loop through and put all parent pages found above current one in array
                        
    while ($parent_id) {
                            
    $page get_page($parent_id);
                            
    $breadcrumbs[] = '<a href="' get_permalink($page->ID) . '">' get_the_title($page->ID) . '</a>';
                            
    $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') .'&nbsp;' $userdata->display_name $currentAfter;
                break;

                case 
    is_day():
                    echo 
    '<a href="' get_year_link(get_the_time('Y')) . '">' get_the_time('Y') . '</a> ' $delimiter ' ';
                    echo 
    '<a href="' get_month_link(get_the_time('Y'),get_the_time('m')) . '">' get_the_time('F') . '</a> ' $delimiter ' ';
                    echo 
    $currentBefore get_the_time('d') . $currentAfter;
                break;

                case 
    is_month():
                    echo 
    '<a href="' get_year_link(get_the_time('Y')) . '">' get_the_time('Y') . '</a> ' $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 
    '</div>';

        endif;



  2. #2
    samcy's Avatar
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    12,098
    Thanks
    121
    Thanked 1,756 Times in 1,442 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Rolf Hassel (Samcy)

  3. #3
    Thread Starter
    plivans's Avatar
    Join Date
    Nov 2012
    Location
    United States
    Posts
    170
    Thanks
    8
    Thanked 11 Times in 11 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    samcy's Avatar
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    12,098
    Thanks
    121
    Thanked 1,756 Times in 1,442 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Rolf Hassel (Samcy)

  5. #5
    Thread Starter
    plivans's Avatar
    Join Date
    Nov 2012
    Location
    United States
    Posts
    170
    Thanks
    8
    Thanked 11 Times in 11 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. #6
    Thread Starter
    plivans's Avatar
    Join Date
    Nov 2012
    Location
    United States
    Posts
    170
    Thanks
    8
    Thanked 11 Times in 11 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  7. #7
    Thread Starter
    plivans's Avatar
    Join Date
    Nov 2012
    Location
    United States
    Posts
    170
    Thanks
    8
    Thanked 11 Times in 11 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. ClassiPress breadcrumb
    By marziocarro in forum ClassiPress General Discussion
    Replies: 2
    Last Post: April 29th, 2013, 03:12 PM
  2. How to rename breadcrumb tags
    By harry0013 in forum ClassiPress General Discussion
    Replies: 2
    Last Post: March 11th, 2013, 10:32 AM
  3. [SOLVED] default breadcrumb file
    By tbase in forum Report Vantage Bugs (Legacy)
    Replies: 3
    Last Post: November 8th, 2012, 09:10 PM