Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter lmccallum

    (@lmccallum)

    Hi, I have confirmed it is not a theme issue. The Glossary is not working on archive pages for my custom post types using the 2020 WP theme. I deactivated all plugins except for (i) Glossary and (ii) the plugin that I wrote to register my custom post type. Here is the code that registers my post type inv_funds:

    function custom_post_type_inv_funds() {

    $labels = array(
    ‘name’ => _x( ‘Investment Funds’, ‘Post Type General Name’, ‘text_domain’ ),
    ‘singular_name’ => _x( ‘Investment Fund’, ‘Post Type Singular Name’, ‘text_domain’ ),
    ‘menu_name’ => __( ‘Investment Funds’, ‘text_domain’ ),
    ‘name_admin_bar’ => __( ‘Investment Funds’, ‘text_domain’ ),
    ‘archives’ => __( ‘Investment Funds’, ‘text_domain’ ),
    ‘attributes’ => __( ‘Item Attributes’, ‘text_domain’ ),
    ‘parent_item_colon’ => __( ‘Parent Item:’, ‘text_domain’ ),
    ‘all_items’ => __( ‘All Items’, ‘text_domain’ ),
    ‘add_new_item’ => __( ‘Add New Item’, ‘text_domain’ ),
    ‘add_new’ => __( ‘Add New’, ‘text_domain’ ),
    ‘new_item’ => __( ‘New Item’, ‘text_domain’ ),
    ‘edit_item’ => __( ‘Edit Item’, ‘text_domain’ ),
    ‘update_item’ => __( ‘Update Item’, ‘text_domain’ ),
    ‘view_item’ => __( ‘View Item’, ‘text_domain’ ),
    ‘view_items’ => __( ‘View Items’, ‘text_domain’ ),
    ‘search_items’ => __( ‘Search Item’, ‘text_domain’ ),
    ‘not_found’ => __( ‘Not found’, ‘text_domain’ ),
    ‘not_found_in_trash’ => __( ‘Not found in Trash’, ‘text_domain’ ),
    ‘insert_into_item’ => __( ‘Insert into item’, ‘text_domain’ ),
    ‘uploaded_to_this_item’ => __( ‘Uploaded to this item’, ‘text_domain’ ),
    ‘items_list’ => __( ‘Items list’, ‘text_domain’ ),
    ‘items_list_navigation’ => __( ‘Items list navigation’, ‘text_domain’ ),
    ‘filter_items_list’ => __( ‘Filter items list’, ‘text_domain’ ),
    );
    $args = array(
    ‘label’ => __( ‘Investment Fund’, ‘text_domain’ ),
    ‘labels’ => $labels,
    ‘supports’ => array( ‘title’, ‘editor’, ‘comments’, ‘revisions’, ‘post-formats’, ‘custom-fields’, ‘page-attributes’, ‘excerpt’),
    ‘taxonomies’ => array( ‘topics’, ‘keys’, ‘document’, ‘sources’, ‘transactions’),
    ‘hierarchical’ => false,
    ‘public’ => true,
    ‘show_ui’ => true,
    ‘show_in_menu’ => true,
    ‘menu_position’ => 6,
    ‘menu_icon’ => ‘dashicons-star-empty’,
    ‘show_in_admin_bar’ => true,
    ‘show_in_nav_menus’ => true,
    ‘can_export’ => true,
    ‘has_archive’ => true,
    ‘exclude_from_search’ => false,
    ‘publicly_queryable’ => true,
    ‘capability_type’ => ‘post’,
    ‘show_in_rest’ => true,
    );
    register_post_type( ‘inv_funds’, $args );

    }
    add_action( ‘init’, ‘custom_post_type_inv_funds’, 0 );

    Can you see anything problematic with my CPT? Previously, I included ‘glossary’ in the supported taxonomies, but that did not help.

    The Glossary terms do work well on my single CPT pages, as you can see in this link: https://box5232.temp.domains/~lexataca/hlm/inv_funds/application/.

    It’s the archive pages that are problematic, as you can see here: https://box5232.temp.domains/~lexataca/hlm/inv_funds/.

    Your plugin documentation states that Glossary supports CPTs and custom taxonomies, which is a key reason that I purchased it, so I really hope that you can help me troubleshoot this. As I said, I tried Glossary with a standard WP theme and I also deactivated every other plugin on my website. The Glossary also works on my standard post archive pages – so it’s a conflict between Glossary and my custom post type archive pages. (I have the same problem with custom taxonomy archive pages, but I have deactivated that plugin for now to focus on one thing at a time.)

    Thanks for your assistance Daniele.

    Thread Starter lmccallum

    (@lmccallum)

    Hi, thanks. I have now removed the only snippet from my site. That snippet successfully created a custom post type before I tried to install Code Snippets. The snippet came from a GenerateWP template. It is publicly available at https://generatewp.com/snippet/GX0O2wz/.

    In addition to deleting the above snippet from my wp files, I have deactivated and deleted the plugin that I created to hold the snippet.

    Yet I still get this message when I try to install Code Snippets:

    An error of type E_PARSE was caused in line 58 of the file /home1/lexataca/public_html/hlm/wp-content/plugins/code-snippets/php/snippet-ops.php(446) : eval()’d code. Error message: syntax error, unexpected end of file.

    Doesn’t the above indicate that the error is on line 58 of your php file snippet-ops.php? For your reference, lines 55-61 of that php code are as follows:

    /* Build a query containing the specified IDs if there are any */
    if ( $ids_count > 1 ) {
    $where = $wpdb->prepare( sprintf(
    ‘ AND id IN (%s)’,
    implode( ‘,’, array_fill( 0, $ids_count, ‘%d’ ) )
    ), $ids );
    }

    Thanks again for your help. As noted above, you can check line 58 of my snippet at the above link. I would be grateful if you would look at it, if you still think the error comes from there, even though it’s been removed from my site and wp files. Best, Leslie

Viewing 2 replies - 1 through 2 (of 2 total)