Tagged: , , , ,

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #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.

    #1111443

    Hey Gitte,

    why u need to add it into this file?

    Best regards,
    Basilis

    #1111445

    I 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.

    #1112154

    Hi,

    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,
    Basilis

    #1112352

    it does not work for me for several reasons; where can I add the snippet in class-breadcrumb.php file please?

    #1112990

    Hi,

    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,
    Basilis

    #1112993

    There 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

    #1113293

    Hi Gitte,

    You can edit this file and add the code here
    /enfold/framework/php/class-breadcrumb.php

    Best regards,
    Victoria

    #1113553

    Victoria, 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-1107045

    #1114768

    Hi,

    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-986525

    Best regards,
    Ismael

    #1114834

    Thank 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:

    View post on imgur.com

    P.S. I am not a coder, so I don’t know how to “write” this in PHP

    #1115033

    Hi,

    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,
    Ismael

    #1115212

    wow, that works perfectly!

    View post on imgur.com

    Thank you very much, Ismael, for your time – you are simply the best!

    #1115810

    Hi,

    You’re welcome! Glad we could help. Please don’t hesitate to open a new thread if you need anything else.

    Have a nice day!

    Best regards,
    Ismael

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘How to add EDIT link in breadcrumbs?’ is closed to new replies.