Categories
CMS Mastering Development Wordpress

Cannot view Custom Post Type no matter what I try

This is my code to register the post type: // Register new post type, User Conversations: b2bking_conversation add_action( ‘init’, array($this, ‘b2bking_register_post_type_conversation’), 0 ); function b2bking_register_post_type_conversation() { // Build labels and arguments $labels = array( ‘name’ => __( ‘Conversations’, ‘b2bking’ ), ‘singular_name’ => __( ‘Conversation’, ‘b2bking’ ), ‘all_items’ => __( ‘Conversations’, ‘b2bking’ ), ‘menu_name’ => _x( […]

Categories
CMS Mastering Development Wordpress

custom post type and hidden url : what is the cleanest way to build CPT with custom page template?

I recently built a website were I needed to let user edit the custom post type archive page with elementor. So I decided to use page templates instead of archive pages, that way,I can build my pages with code (custom loop) and elementor (widgets). But after navigating in my website, I spotted strange behaviours. I’m […]

Categories
CMS Development Wordpress

Custom post type defaults to index.php for archive page

I’ve developed a custom theme with a custom post type named events. For some reason, however, WP refuses to use my archive page template with the file name archive-events.php per WP’s template hierarchy. WP keeps defaulting to index.php as the template for this post type. Previously I had a page configured in WP that was […]

Categories
CMS Development Wordpress

How do i enable categories for my custom post type?

I have a custom pos type created in functions.php and working great – except I need to have categories enabled. I have looked through other answers here, and am still not able to figure it out. In my code i have taxonomies => array(‘categories’, ‘tags’) but it is not working. Here is my code: function […]

Categories
CMS Development Wordpress

How to create custom status for post and change it after x days

I’m trying to create a new custom status for WP post and custom posts to make specific queries. I used this function to achieve this but without results: // Registering custom post status function wpb_custom_post_status(){ register_post_status(‘archived’, array( ‘label’ => _x( ‘Archived’, ‘post’ ), ‘public’ => false, ‘exclude_from_search’ => false, ‘show_in_admin_all_list’ => true, ‘show_in_admin_status_list’ => true, […]

Categories
CMS Development Wordpress

custom post type unique slug causing issues with post id

I’ve included all of the relevant code below. Here is what I’m trying to accomplish: A custom taxonomy of flavor. A custom post type of product. The ability to have flavor/product-name and another-flavor/product name vs product-name & product-name-2. What I’m experiencing with the code below is on the front end the 2nd product with the […]

Categories
CMS Development Wordpress

Custom post type single page returns 404

Before posting I tried almost every suggestion from searching StackExchange and google. Overview: When I enter the permalink of a post it returns a 404. When I click on a link created by get_the_permalink(); I will see a 404 and this url structure ?post_type=lunchlearn&p=530 rather than /lunchlearn/burner-start-up-and-tech/ I’ve tried saving the permalink structure, flush_rewrite_rules, different […]

Categories
CMS Development Wordpress

Search Function not searching correct custom_post_type even though post_type is defined in search args

I have a custom post type of job_listing and a custom_post_type of job_application. Each job_application post has a parent within the job_listing post_type So if a job listing for an Office Receptionist has 5 applications, then this post will have 5 children within the job_application post_type all having their post_parent ID as the Office Receptionist […]

Categories
CMS Development Wordpress

post_type_link not working in gutenberg

There are tons of answers on using the post_type_link filter. The code in the gist works perfectly with one exception…gutenberg. If I disable gutenberg on the post types in question then the code works. Or if I save from the quick edit the code works. But if gutenberg is active then the client, date nor […]

Categories
CMS Development Wordpress

Custom Post Type with Template – Template is not used

i created a custom post tpye function ABECrm_post_type() { $labels = array( ‘name’ => __( ‘Agenden’, ‘ABECrm’ ), ‘singular_name’ => __( ‘Agenda’, ‘ABECrm’ ), ‘add_new’ => __( ‘Neue Agenda’, ‘ABECrm’ ) ); $args = array( ‘label’ => __( ‘agenda’, ‘ABECrm’ ), ‘description’ => __( ‘Hier werden die Agenda-Seiten eingetragen’, ‘ABECrm’ ), ‘labels’ => $labels, ‘supports’ […]