• I’m not very good at English.
    I’m sorry that the meaning is hard to understand because I use the translation function.

    I’ve found notice error on default post type template says:

    Warning: Undefined array key "bpost_post_archive_display" in /var/www/html/wp-content/plugins/breadcrumb-navxt/class.bcn_breadcrumb_trail.php on line 1105 Warning: Undefined array key "bpost_post_archive_display" in /var/www/html/wp-content/plugins/breadcrumb-navxt/class.bcn_breadcrumb_trail.php on line 809

    When you add this to the 100 line of the error file message has disappeared
    'bpost_post_archive_display' => true,

    Is there a problem with the addition?
    Also, are there any other solutions?

    PHP: 8.0
    MYSQL: 5.7
    Wordpress: 5.8

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author John Havlik

    (@mtekk)

    It is not recommended to edit the plugin files, any changes will be lost when you update the plugin.

    What page, on your site, are you visiting when you get this error? This occasionally comes up, but I have never been able to recreate it on my test site.

    Thread Starter himeka

    (@himeka)

    Thank you for your answer.

    This error occurs on the post list page in archive.php.

    The customizations that appear to be influenced by function.php are:

    /**
     * @param string $breadcrumb_trail .
     */
    function my_static_breadcrumb_adder( $breadcrumb_trail ) {
        if ( is_search() || get_post_type() === 'post' ) {
            $item                            = new bcn_breadcrumb( 'SIOSDX Blog', '', array( '' ), home_url( 'blog' ), null, true );
            $stuck                           = array_pop( $breadcrumb_trail->breadcrumbs );
            $breadcrumb_trail->breadcrumbs[] = $item;
            $breadcrumb_trail->breadcrumbs[] = $stuck;
        }
        if ( is_tag() ) {
            $item     = new bcn_breadcrumb( 'tags', '', array( '' ), null, null, true );
            $tag_name = array_shift( $breadcrumb_trail->breadcrumbs );
            array_unshift( $breadcrumb_trail->breadcrumbs, $tag_name, $item );
        }
        if ( is_singular( 'solution' ) ) {
            if ( 5 === count( $breadcrumb_trail->trail ) ) {
                unset( $breadcrumb_trail->trail[1] );
            }
        }
    }
    /**
     * @param string $args .
     * @param string $post_type .
     */
    function post_has_archive( $args, $post_type ) {
        if ( 'post' === $post_type ) {
            $args['rewrite']     = true;
            $args['has_archive'] = 'blog';
        }
        return $args;
    }
    add_filter( 'register_post_type_args', 'post_has_archive', 10, 2 );
    /**
     * @param string $permalink .
     */
    function add_article_post_permalink( $permalink ) {
        // デフォルトの投稿の記事詳細に<code>/blog/</code>(アーカイブ名)を追加する .
        $permalink = '/blog' . $permalink;
        return $permalink;
    }
    add_filter( 'pre_post_link', 'add_article_post_permalink' );
    /**
     * リライトルール
     */
    add_rewrite_rule( 'blog/([^/]+)/?$', 'index.php?category_name=$matches[1]', 'top' );
    add_rewrite_rule( 'blog/tags/([^/]+)/?$', 'index.php?tag=$matches[1]', 'top' );
    add_rewrite_rule( 'blog/([^/]+)/page/([0-9]+)/?$', 'index.php?category_name=$matches[1]&paged=$matches[2]', 'top' );
    Plugin Author John Havlik

    (@mtekk)

    Is there a reason that you are not using the ‘static front page’ option within WordPress (under Settings > Reading)? Using WordPress’ feature for static front pages would prevent the need for the bulk of your custom code there, including the rewrite rules (Breadcrumb NavXT would no longer throw the error as well).

    Thread Starter himeka

    (@himeka)

    Thank you.
    I have set the WordPress “Static Front Page” option.
    The error on line 1105 has disappeared, but the error on line 805 has not disappeared …
    Is there anything else you can think of?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Undefined array key in class.bcn_breadcrumb_trail.php on line 1105, 809’ is closed to new replies.