-
AuthorPosts
-
June 17, 2019 at 6:02 pm #1111075
Hi,
could you please tell me, where to add
echo edit_post_link(__(' <span style="color: #ff0000; font-weight: bold; font-size: 11px;">EDIT</span>'));
into the class-breadcrumb.php file
so that there is an EDIT link at the frontend page (no matter if I create it with ALB or without it)?
It should look like this composing:
Or is it probably possible with a function like this?
Thank you.
June 18, 2019 at 7:26 pm #1111443Hey Gitte,
why u need to add it into this file?
Best regards,
BasilisJune 18, 2019 at 7:30 pm #1111445I had trouble with adding the EDIT link in pages created with the ALB, because at the beginning of the content it looks weird and adding it at the end of the content does not work if the content has parts which are shown only on mobile.
So the breadcrumb section is for me the best place to add the EDIT link, because there I can access it reliable from everywhere.
If you could help me out to add
echo edit_post_link(__(' <span style="color: #ff0000; font-weight: bold; font-size: 11px;">EDIT</span>'));
into the class-breadcrumb.php file, it would be fine. Since I am not a coder, I don’t know where and how to add this snippet. Thank you.
June 21, 2019 at 12:42 am #1112154Hi,
Why not add the edit on the bottom of the single.php or the page.php for example? Easier to edit it there…
Best regards,
BasilisJune 21, 2019 at 3:34 pm #1112352it does not work for me for several reasons; where can I add the snippet in class-breadcrumb.php file please?
June 24, 2019 at 8:05 pm #1112990Hi,
Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
BasilisJune 24, 2019 at 8:28 pm #1112993There should be something like @ismael suggested here – but only for class-breadcrumb.php
https://kriesi.at/support/topic/edit-link-for-alb-pages/#post-1107045
June 25, 2019 at 4:57 pm #1113293Hi Gitte,
You can edit this file and add the code here
/enfold/framework/php/class-breadcrumb.phpBest regards,
VictoriaJune 26, 2019 at 9:48 am #1113553Victoria, I really do not understand your answers all the time and it is meanwhile really annoying that your answers don’t lead to anything sensefull at all.
Why?
Have you read my question? No!
Have you read the link I posted to @ismael? No.
Otherwise you won’t tell me what file I need to edit, because that was my question!Please forward it to @ismael who already had a solution for me here but I run into some troubles with in, so I need to modify his solution for the class-breadcrumb.php:
https://kriesi.at/support/topic/edit-link-for-alb-pages/#post-1107045July 1, 2019 at 4:37 am #1114768Hi,
Sorry for the confusion. You should be able to append something at the end of the breadcrumb using the “avia_breadcrumbs_trail” filter. A few examples can be found in the following threads.
// https://kriesi.at/support/topic/auto-draft-in-breadcrumbs/#post-1014600
// https://kriesi.at/support/topic/portfolio-category-name-in-breadcrumb-not-translated/#post-925050
// https://kriesi.at/support/topic/article-title-x2-in-breadcrumb/#post-986525Best regards,
IsmaelJuly 1, 2019 at 9:50 am #1114834Thank you @ismael,
but I don’t get this to work, to add the EDIT link to the breadcrumb:
add_filter( 'avia_breadcrumbs_trail', 'avia_breadcrumbs_trail_mod', 50, 2 ); function avia_breadcrumbs_trail_mod( $trail, $args ) { if ( is_single() ) { echo edit_post_link(__(' <span style="color: #ff0000; font-weight: bold; font-size: 11px;">EDIT</span>')); } return $trail; }
There simply appears no EDIT link:
P.S. I am not a coder, so I don’t know how to “write” this in PHP
July 2, 2019 at 6:00 am #1115033Hi,
Thank you for the update.
Replace that code with the following snippet.
add_filter( 'avia_breadcrumbs_trail', 'avia_breadcrumbs_trail_mod', 50, 2 ); function avia_breadcrumbs_trail_mod( $trail, $args ) { ob_start(); edit_post_link(__(' <span style="color: #ff0000; font-weight: bold; font-size: 11px;">EDIT</span>')); $edit = ob_get_clean(); $trail[] = $edit; return $trail; }
That should append the edit link to the breadcrumb trail.
Best regards,
IsmaelJuly 2, 2019 at 4:09 pm #1115212wow, that works perfectly!
Thank you very much, Ismael, for your time – you are simply the best!
July 4, 2019 at 3:17 pm #1115810 -
AuthorPosts
- The topic ‘How to add EDIT link in breadcrumbs?’ is closed to new replies.