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

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

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’ […]

Categories
CMS Development Wordpress

WP_Query not using custom taxonomy categories on custom post type

So I have both a custom post type which is called ‘Recipes’ in my register method() as shown below: public static function register() { add_action(‘init’, function() { $labels = array( ‘name’ => __(‘Recipes’), ‘singular_name’ => __(‘Recipe’), ‘nickname’ => __(‘Recipe’), ‘add_new’ => _x(‘Add Recipe’, ‘Recipe’), ‘edit_item’ => __(‘Edit Recipe’), ); $args = array( ‘labels’ => $labels, […]

Categories
CMS Development Wordpress

Only show certain custom posts in all_items

When I register my custom post it adds a menu option to the WP Admin Dashboard that users can click and it lists all custom posts of that type. (Please see my image below if I am not making sense about the page I am describing). That page listing all the custom posts of that […]

Categories
CMS Development Wordpress

Admin search for custom post type shows results for everything but my post type

I’ve added a custom post type with this: <?php if ( ! function_exists(‘ordinances’) ) { function ordinances() { $args = array( ‘label’ => __( ‘Ordinance’, ‘text_domain’ ), ‘description’ => __( ‘Ordinances’, ‘text_domain’ ), ‘labels’ => $labels, ‘supports’ => array( ‘title’ ), ‘taxonomies’ => false, ‘hierarchical’ => false, ‘public’ => true, ‘show_ui’ => true, ‘show_in_menu’ => […]

Categories
CMS Development Wordpress

Custom post type not using custom template

So I’ve been working on a WordPress site, and I need a custom post for documents, which is supposed to be registered as ‘document’. I generated the code for the custom post in a plugin, Meta Box, and placed the code in my functions.php file (though while testing, I disabled Meta Box to see if […]

Categories
CMS Development Wordpress

Return all posts in custom post type into an array

So I want to be able to return an array of all the ids within my custom post type but I can’t seem to figure out how to target the arrays in part Here is what I have inside my class: private $id; private $name; private $bio; private $thumbnail; // Initialize the object’s methods public […]