php - wordpress - is it possible to add one post with multiple custom post type -


i have create module admin admin can manage post. suppose have create 3 post types

  1. new added post type
  2. entertainment post type
  3. featured post type

when user add post post come can add "new added post type" or "entertainment post type", show in admin module respective post type module manage admin.

so main issue if admin want show post in "featured post type" admin can this.

as per concern admin can switch post "featured post type". , post remove "old post type".

so main issue want show post in both post type in front end front end users end module admin user.

this fact single can not 2 types because in database can store single value this.

but according case don't think difficult task. have problem of end unable show post under 2 types. not need create different post types each.

just create category , add post in category

1) category 1 2) category 2 3) category 3 4) category 4 

you can create multiple category , subcategory , can assign multiple category single post

the main thing separate module per category can add following code separate module each category dynamically

just need focus on this.....

following code show menu of category parent category can manage separately

<?php /*** ** plugin name,description */ /************* plugin code ************/ $cpost = new cust_post(); class cust_post{      public function __construct()     {     $this->pluginname      = 'manage posts';     add_action('admin_menu', array(&$this,'admin_myplugin_menu'));      }      function admin_myplugin_menu(){     $cats = get_categories();           if ($cats) {          $i = 0;         foreach($cats $k=>$cat) {             if($cat->category_parent == 0){             if($i == 0){                 // if first show main menu                 add_menu_page(__($this->pluginname, $this->pluginname), __($this->pluginname, $this->pluginname), 'mp', 'mp', ''));             }             // show submenu             add_submenu_page('mp', $cat->name." posts", $cat->name." posts", "administrator", 'edit.php?category_name='.$cat->slug, '');             $i++;             }         }           }      }  } ?> 

hopefully . helpful.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -