Custom Post Type with assigned Post

0

I need to have in the administration an option called "Educational Institutions" and that's why I created a CPT called "ie" but it should not be with URL, that is, it should always be wwww.misitio.com/institucion-educativa-wordpress and no wwww.misitio.com/ie/institucion-educativa-wordpress.

When the administrator enters the CPT "Educational Institutions" will create the respective Institutions with their information, something like the deployment of each institution but additionally need editorial notes that belong to that CPT, that is to say: wwww. misitio.com/institucion-educativa-wordpress/nota-editorial-sobre-wordpress.

It would be like adding the functionality of Post within a Custom Post Type, I think of it as:

  • Educational Institutions
    • Add new Institution
    • Editorial Notes
      • Add New Editorial Note
      • Categories
      • Tags
    • Categories
    • Tags

I'm not sure what can be done, however, it may be.

    
asked by pio 28.05.2016 в 08:26
source

3 answers

1

@pio the only thing that comes to mind (I'm new to WordPress) is a structure of this style (birth of the premise that educational institutions is within an index.php): A page called Educational Institutions with its corresponding template php . In that template, you place the code that is necessary to carry institutions. Then, you create another page called Add new institution (with its corresponding template) and you make it the daughter of the previous one (Educational Institutions). You also make another Editorial Notes page (always with its corresponding php template) that is the daughter of Educational Institutions and sister of Add new institution. Now I see 2 options, depending on what you want: The first is that in the Editorial Notes code links created with the CPT-UI and Custom Advanced Fields by loops and querys. With this option in the same page of Editorial Notes, you would have the 3 fields (within it, being the same page). Now, if what you want is that each of these options go to another page, it would be to repeat the same process: Create the three pages (add new editorial note, categories and tags) that are sisters among themselves but daughters of Editorial Notes. Doing it this way, the URL would include the section.

Then, for the Categories and tags that do not go into Editorial Notes, you would do it by making two pages of daughters of educational institutions, sisters of adding new institution and editorial notes (and sisters among themselves of course).

I leave you an image of what the hierarchy would look like with the pages themselves, where each one hangs, etc. (I did not say in a section that they are sisters because they would not read well and would cause confusion but they are understood).

With the posts of the CPT-UI + Custom Advanced Files you would add the information of each section in the corresponding page and then by means of WordPress loops etc. showing the information.

    
answered by 31.05.2016 в 16:33
1

It seems you need your custom post type "Educational Institutions" to be related to "something" called "Editorial Notes" so that you can access the url "misitio.com/nombre-de-la-institucion/nombre- de-la-nota-editorial ". I suppose that having the custom type developed, you will have the template that shows them as well, along with the query loop.

From here, it is necessary to relate the "Editorial Notes" with the corresponding "Educational Institution", I suppose so that each "Educational Institution" has from zero to many "Editorial Notes".

One possible solution would be to create another custom type for the "Editorial Notes" that has a custom field called "Educational Institution" that is of the drop-down type and that allows to select an institution that already exists in the system. So that when storing the custom type "Editorial Note" is stored next to what "Educational Institution" belongs.

Finally, it would only be necessary to modify the query loop of the "Educational Institutions" so that they can consult all the "Editorial Note" posts that have a field called in the same way as the name of the "Educational Institution" that we are consulting.

    
answered by 31.05.2016 в 11:40
0

I found another very practical solution via: link .

It's amazing and it works better because it allows you to manage each custom post type without linking it through a plugin.

    
answered by 19.09.2016 в 03:55