-
Author
Tagged: breadcrumb
-
January 27, 2015 at 17:44 #43612morethantheskyParticipant
Is there any way to hack the breadbrumbs so that I can add a root site before “Home”? Also can I change the word “home” in what it perceives as the root home page to something else?
Thank you!
January 27, 2015 at 22:13 #43649morethantheskyParticipantSo I’ve found in kleo-framework/lib/function-breadcrumb.php the $defaults array in which there is a ‘network’ switch, which is what I was looking for. It’s set to ‘false’ by default, but when I set it to ‘true’, it adds the network home, but I don’t see in the front end where I can set this flag? Don’t want to edit the core files since an upgrade will wipe the changes, but I don’t see in the admin options where to tell the breadcrumbs to be for a network.
Thanks!
January 27, 2015 at 22:26 #43659sharmstrModeratorYou dont need to edit it. If you look a few lines down, you can filter it.
Check this out. Tailor to your needs. http://wordpress.stackexchange.com/questions/104094/how-do-i-edit-a-plugins-core-properly
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
January 27, 2015 at 22:37 #43662morethantheskyParticipantOh my gosh I love you, you’re awesome.
I do have a question though. The syntax has changed a little since that page you’ve referred me to. It’s now this:
$this->args = apply_filters(‘breadcrumb_trail_args’, wp_parse_args($args, $defaults));
How would I edit this in my functions.php to reflect the new syntax?
function wpse_104094_breadcrumb_trail_args( $args ) {
$args[‘network’] = ‘true’;
return $args;
}add_filter( ‘breadcrumb_trail_args’, ‘wpse_104094_breadcrumb_trail_args’ );
January 27, 2015 at 22:39 #43663morethantheskyParticipantPer this page, it should work as is, no? But it doesn’t work on my site, so I’m clearly missing something
January 27, 2015 at 22:51 #43665morethantheskyParticipantOk I figured it out. Was passing ‘true’ instead of true. Took away the quotes and it worked. Knew it would be something small.
Thank you again for your help today!
January 27, 2015 at 23:15 #43673sharmstrModeratorI’ve never played around with a network install so I cant test it for you. But if I add something ridiculous like
COPY CODEfunction wpse_104094_breadcrumb_trail_args( $args ) { $args['before'] = 'Yo'; $args['network'] = true; return $args; } add_filter( 'breadcrumb_trail_args', 'wpse_104094_breadcrumb_trail_args' );
I also put a default value in ‘before’ and it used Yo instead of my default value. So, it is filtering the defaults.
You can see by adding this below the apply_filters statement.
COPY CODEprint_r($this->args);
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
Attachments:
You must be logged in to view attached files.January 27, 2015 at 23:15 #43675sharmstrModeratorahhh. good. I’m glad you sorted it.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
January 27, 2015 at 23:17 #43676sharmstrModeratorbtw – Last night I spent almost an hour debugging a function. Turns out I had filed instead of field. So frustrating.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.