[Resolved] outputting faq breadcrumb

Home Forums Support [Resolved] outputting faq breadcrumb

Home Forums Support outputting faq breadcrumb

  • This topic has 9 replies, 3 voices, and was last updated 1 week ago by David.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2012053
    Paul

    I use Yoast and another plugin to provide a FAQ section on my website.

    Using GP elements I output the breadcrumb from yoast and this works fine.

    However, the FAQ plugin also outputs a breadcrumb below the header and so I end up with 2 breadcrumbs. I can disable the yoast breadcrumb for the page but the faq breadcrumb is in a different place so it looks a bit odd.

    Is there any way I can output the FAQ breadcrumb in the same place where the yoast one would be?

    example:

    https://www.suddencardiacarrestuk.org/faq-questionelectromagnetic-interference/is-it-safe-to-be-around-my-electric-vehicle-when-its-charging/

    #2012279
    David
    Staff
    Customer Support

    Hi there,

    thats something you would need to ask the FAQ plugin author – currently that breadcrumb is displayed within the Content of the page. They may have a filter or function that will allow it to be hooked elsewhere.

    #2019409
    Paul

    Ok, what specifically do I need to ask of them (sorry I’m not familiar with the technical details of how this works)

    #2019442
    David
    Staff
    Customer Support

    Ask them if:

    a) there is a filter to disable the breadcrumbs within the_content
    b) if there is callback function we can Hook into our theme templates to display the breadcrumbs outside of the content.

    #2021845
    Paul

    Hi David,

    They replied with a No for (a), but for (b)…

    Yes, use the follow method:
    com\cminds\cmfaq\plugin\classes\Frontend::the_breadcrumb();
    Should be called after global $post is set

    Would you be able to show me what I need?
    Thanks for your help so far

    Regards

    #2022627
    Elvin
    Staff
    Customer Support

    Hi Paul,

    We can easily place the same breadcrumb CM Faq uses using a Hook Element.

    Add this PHP snippet on a hook element and set the hook element to Execute PHP:

    <?php 
    CMFAQ_Frontend::the_breadcrumb();
    ?>

    Set the hook to generate_after_header and set the display rule to Faq Questions – Al faq questions.

    But the problem is we can’t remove the one added within the content because it is hard coded to the plugin’s post.php file.
    https://share.getcloudapp.com/RBuEb1jR

    If you don’t mind hiding it instead of completely removing it, we can hide it with CSS.

    Try this:

    .entry-content .cmfaq-breadcrumb {
        display: none;
    }

    A wise man once said:
    "Have you cleared your cache?"

    #2023606
    Paul

    ok, thanks, however, I tried that and it threw an error…

     Fatal error: Uncaught Error: Class "CMFAQ_Frontend" not found
    in /home/xxx/public_html/wp-content/plugins/gp-premium/elements/class-hooks.php(215) : eval()'d code on line 2
    
    Call stack:
    
    eval()
    wp-content/plugins/gp-premium/elements/class-hooks.php:215
    GeneratePress_Hook::execute_hook()
    wp-includes/class-wp-hook.php:303
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:327
    WP_Hook::do_action()
    wp-includes/plugin.php:470
    do_action()
    wp-content/themes/generatepress/header.php:56
    require_once()
    wp-includes/template.php:770
    load_template()
    wp-includes/template.php:716
    locate_template()
    wp-includes/general-template.php:48
    get_header()
    wp-content/themes/generatepress/single.php:12
    include()
    wp-includes/template-loader.php:106
    require_once()
    wp-blog-header.php:19
    require()
    index.php:17
    #2024038
    David
    Staff
    Customer Support

    Might be best to ask the plugin author how to call that method outside of its plugin.

    #2031322
    Paul

    Hi,

    The plugin supplier told me to modify the call with the full class path and it worked.

    Thanks

    #2031413
    David
    Staff
    Customer Support
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.