Forum Replies Created
-
AuthorPosts
-
October 20, 2015 at 9:54 am in reply to: How to modify in child_theme the function avia_breadcrumbs() finished with "s" #521451
Thank you very much, ismael. It was my fault! I didn’t noticed the apply filters for trail:
/* Allow child themes/plugins to filter the trail array. */ $trail = apply_filters( 'avia_breadcrumbs_trail', $trail, $args );
I will use it.
Thanks!
Núria
October 19, 2015 at 9:34 pm in reply to: How to modify in child_theme the function avia_breadcrumbs() finished with "s" #521202Hi Elliot, thanks for your answer, but the apply_filters() is only for the function args, and I don’t need to modify the args, they are ok.
What I need is hack the breadcrumb when it is a child of certain categories (hornos/placas) to put an specified page as parent instead of the archive page of the category. This is because they are using posts like products or portfolio, and this posts has a page (normal page) as a parent.
So I have done this change begining in line 301:if(isset($category[0]) && empty($parents)) { // nra: modified to show the page instead the category //category hornos = 8, category plaques = 8, page hornos = 106 , page placas = 109 $catid = $category[0]->term_id; if( $catid == 8 or $catid == 9) { if($catid == 8 ) { $trail[] = '<a href="'.get_page_link(106).'">'.get_the_title(106).'</a>'; } elseif($catid == 9) { $trail[] = '<a href="'.get_page_link(108).'">'.get_the_title(108).'</a>'; } }else { $trail[] = '<a href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'</a>'; } //end nra }
May be there is another approach that I have not thought, or not.
Thanks in advance!
Núria
October 18, 2015 at 6:35 pm in reply to: How to modify in child_theme the function avia_breadcrumbs() finished with "s" #520669Hei Elliott, thanks for your quicly response.
I think I didn’t explain well, in the class-breadcrumb.php there are one class: avia_breadcrumb() that is from line 1 to 144 and is wrapped with “class_exists”. This is correct. But I’m talking about a function written in the same file, but from line 149, that begin with this comments:
/*———————————————————————————–*/
/* avia_breadcrumbs() – Custom breadcrumb generator function */
/*
/* Params:
/*
/* Arguments Array:
/*
/* ‘separator’ – The character to display between the breadcrumbs.
/* ‘before’ – HTML to display before the breadcrumbs.
/* ‘after’ – HTML to display after the breadcrumbs.
/* ‘front_page’ – Include the front page at the beginning of the breadcrumbs.
/* ‘show_home’ – If $show_home is set and we’re not on the front page of the site, link to the home page.
/* ‘echo’ – Specify whether or not to echo the breadcrumbs. Alternative is “return”.
/* ‘show_posts_page’ – If a static front page is set and there is a posts page, toggle whether or not to display that page’s tree.
/*
/*———————————————————————————–*/This function is called avia_breadcrumbs() (with an “s” at the end to distinct from class avia_breadcrumb(). As I can see, this function is not wrapped by an “class_exists” statement, so it can’t be cloned in child theme functions.php. And this function seems to be indepent to the class, cause it’s not called inside the class.
I don’t know where in the theme (may be there is an option in option panel, but I can’t see it) is calling this function instead de class. This is not a project of mine, but a colleague are asked me to help with a modification in the breadcrum. And actually the theme in this install is using this function and not the class. You can see it in action in http://pando.topimatge.com/horno-39-microondas-22-l-phm-9500/
I have made the change in the function (not class) (but in parent theme) and is running correctly. But I would have to can do it in the theme child, not parent.Any idea? Thanks in advance
Núria
-
AuthorPosts