Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter swtyndall

    (@swtyndall)

    Hi Michael,

    Thank you so much for your help with this! I’m really impressed. I did want to move forward with fixing this but my client is going with some local tech help and doesn’t want my help anymore. Sorry about not getting back to you sooner!!!

    Best of luck with everything!!

    Steve

    Thread Starter swtyndall

    (@swtyndall)

    I was looking at the functions.php file and I suspect something may be a bit off about it. I see cptui referenced a few times and I see where the CPT appears to be called “Weekly” in certain places and “Weekly post” in others. Not familiar enough with how PHP and this neve child theme file works to really understand what I am seeing. I did notice that has archive was false, so I changed to true to see if the archives might start working.

    Here’s the text of the functions.php file:

    <?php

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit;
    }
    if ( ! function_exists( ‘neve_child_load_css’ ) ):
    /**
    * Load CSS file.
    */
    function neve_child_load_css() {
    wp_enqueue_style( ‘neve-child-style’, trailingslashit( get_stylesheet_directory_uri() ) . ‘style.css’, array( ‘neve-style’ ), NEVE_VERSION );
    }
    endif;
    add_action( ‘wp_enqueue_scripts’, ‘neve_child_load_css’, 20 );

    // Create Weekly Content Post Type
    function cptui_register_my_cpts_weekly() {

    /**
    * Post Type: Weekly Posts.
    */

    $labels = [
    “name” => __( “Weekly Posts”, “neve” ),
    “singular_name” => __( “Weekly Post”, “neve” ),
    ];

    $args = [
    “label” => __( “Weekly Posts”, “neve” ),
    “labels” => $labels,
    “description” => “”,
    “public” => true,
    “publicly_queryable” => true,
    “show_ui” => true,
    “show_in_rest” => true,
    “rest_base” => “”,
    “rest_controller_class” => “WP_REST_Posts_Controller”,
    “has_archive” => true,
    “show_in_menu” => true,
    “show_in_nav_menus” => true,
    “delete_with_user” => false,
    “exclude_from_search” => false,
    “capability_type” => “post”,
    “map_meta_cap” => true,
    “hierarchical” => false,
    “rewrite” => [ “slug” => “weekly”, “with_front” => true ],
    “query_var” => true,
    “supports” => [ “title”, “editor”, “thumbnail” ],
    “taxonomies” => [ “category” ],
    ];

    register_post_type( “weekly”, $args );
    }

    add_action( ‘init’, ‘cptui_register_my_cpts_weekly’ );

    Thread Starter swtyndall

    (@swtyndall)

    Thank you for the quick response, Michael!

    Question 1. Yes I am trying to locate where it is being registered. For some reason it doesn’t appear to be editable by elementor pro, and from what research I have done, this appears to be because of how it is registered. I am fairly PHP illiterate, and I need to be able to edit the static text that surrounds the custom fields and perhaps add more custom fields and right now, the only way I can figure out how to do that for now is by editing the PHP file for this CPT–a far less than ideal situation.

    When I inherited this site, CPT UI was installed, yet this “weekly” CPT was not registered with it. What would account for the inability to edit this CPT in elementor pro? Perhaps it needs to be registered instead with CPT UI or the registration was done incorrectly and that needs to be edited. I haven’t been able to figure it out…

    Also certain archives don’t work for this CPT. I’ve tried numerous different plugins that allow you to specify post type, and displaying recent posts, works fine. When I try to display a categories archive, it retrieves the categories yet when you click on the category to go to a list of posts, it can’t find or display any of the posts in that category. Same thing for a month based archive, it shows the months that posts have been created in, yet the links take you to a page that says nothing can be found. Also, search doesn’t appear to work correctly with this CPT, which by the way is the only post type being used on the site.

    Question 2 The Weekly post type is the only one in use and the only one giving me problems. Is the slug “Weekly”? I’m having trouble figuring out how to determine the slug. In some places it appears to refer to it as “Weekly Posts”.

    Any suggestions you have are greatly appreciated!!!!

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