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 Mastering Development Wordpress

programmatically generated custom post type is created more than once

I have this code that is supposed to limit the user to the edit of (only) one predefined created custom post type. I want to setup only one post that is responsable to manage the homepage contents. I have an issue, I’ve noticed that the post type is ceated more than one time, I need […]

Categories
CMS Development Wordpress

Custom taxonomy returns 404 even with saving permalinks

I’m trying to register a custom posttype and custom post type taxonomy. But when I create a term and click the button “view” to see the custom taxonomy page it returns a 404. I’ve tried resaving the permalinks a 1000 times, doesn’t work. function build_blog_post_type() { register_post_type ( ‘blog’, array ( ‘labels’=> array ( ‘name’ […]

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

show same table content as custom post type ‘show all’ page on another page

I have a basic CPT: function add_news_post_type() { $args = array( ‘public’ => true, ‘label’ => ‘News’, ‘rewrite’ => array(‘slug’ => ‘news’), ‘has_archive’ => true, ‘supports’ => array(‘title’, ‘editor’, ‘thumbnail’, ‘excerpt’), ‘labels’ => array( ‘name’ => ‘News’, ‘add_new_item’ => ‘Add News’, ‘edit_item’ => ‘Edit News’, ‘all_items’ => ‘All News’, ), ); register_post_type(‘news’, $args); // taxonomy […]

Categories
CMS Development Wordpress

How to create a separate ‘archive widget’ only for my cpt ‘portfolio’?

I am creating one custom wordpress theme for my portfolio. I have created one cpt as below: function codex_custom_init() { register_post_type( ‘Theme Settings’, array( ‘labels’ => array(‘name’ => __( ‘Theme Settings’ ), ‘singular_name’ => __( ‘Theme Settings’ ) ), ‘public’ => true, ‘has_archive’ => true, ‘supports’ => array(‘title’, ‘editor’, ‘thumbnail’), ‘menu_icon’ => ‘dashicons-admin-generic’, ) ); […]

Categories
CMS Development Wordpress

Unable to edit categories in custom post type

I have a custom post type created using the following code: // Event Post type register_post_type(‘event’, array( ‘capability_type’ => ‘event’, ‘map_meta_cap’ => true, ‘supports’ => array(‘title’, ‘editor’, ‘excerpt’, ‘revisions’), ‘rewrite’ => array(‘slug’ => ‘events’), ‘has_archive’ => true, ‘public’ => true, ‘labels’ => array( ‘name’ => ‘Events’, ‘add_new_item’ => ‘Add new event’, ‘new_item’ => ‘New Event’, […]

Categories
CMS Development Wordpress

Make custom post type a media library

So I have the below code on attempting to create a media library custom post type but I’m not getting the media library and it’s just a regular post type. Here is the method inside my class: public static function doc_post_type() { add_action(‘init’, function() { $labels = array( ‘name’ => _x(‘Doc’, ‘post type general name’), […]

Categories
CMS Development Wordpress

Make custom post type a media library

So I have the below code on attempting to create a media library custom post type but I’m not getting the media library and it’s just a regular post type. Here is the method inside my class: public static function doc_post_type() { add_action(‘init’, function() { $labels = array( ‘name’ => _x(‘Doc’, ‘post type general name’), […]

Categories
CMS Development Wordpress

Make custom post type a media library

So I have the below code on attempting to create a media library custom post type but I’m not getting the media library and it’s just a regular post type. Here is the method inside my class: public static function doc_post_type() { add_action(‘init’, function() { $labels = array( ‘name’ => _x(‘Doc’, ‘post type general name’), […]