0

I have a custom post type that call Investigators that has sub categories of Investigator.

Am trying to figure out the best way to create a templating system for each investigator. In essence EACH investigator will be a microsite with about 10 pages, each having it's own menu and modules like staff, etc.

Currently I have set up a Parent - child dynamic, so for ex:

  • investigator 1
    • investigator 1 subpage
    • investigator 1 subpage
    • investigator 1 subpage
    • investigator 1 subpage
    • investigator 1 subpage

I'd like to be able to build a design/template for investigator 1 that will then apply to all the child pages.

Am thinking I could use ACF flexible content to build a menu, nav, that then applies through out. Just not sure what's the best option/way to do this.

I know I could do a page for each but i'd like for the user to be able to just select options to build the template from pre-existing modules (hence ACF.)

Here is a screenshot: http://prnt.sc/cnr3kd The orange bar and below is an investigator/faculty each with their own navigation and other modules.

Any advise direction is appreciated.

1 Answer 1

-1

Better way to do it would be to create a single page with a submenu on it. This menu would be created in the template for the custom post type. You'll have your main menu loading on the site, but when the load your investigator the user will see a second menu (beneath or on the side in widget area) that will allow them to navigate the subpages of that investigator.

I've done that several times and it works out well.

Another option (depending on your theme) would be to create a tabbed widget (visual composer anyone?!?) you could take advantage of that would allow users to see different sections on a page but never move away from the actual investigator page itself.

ACF doesn't create pages for you as separate instances.

IF you were to go down the path of creating individual pages you could create links that would go to

permalink() . "-subpage1" and permalink(). "-subpage2" in page template file, and then assign each of those subpages to the template you created.

based on what you're doing i would definitely look at this page because you're going to want more than 1 post type potentially and create relationships with them: https://www.advancedcustomfields.com/resources/relationship/

pay attention to the reverse relationships on there too.

EDITS for further comment questions.

just to clarify, parent and child are your themes, and then we'll call the page that shows all your investigators the archive page and individual pages for your investigators will be called the single page.

I don't actually know the exact name of your post-type, but hopefully you're using a prefix on your identifier so for our example we're going to say that your post type is mi_investigator.

After creating a post type wordpress magic will let you see all your investigator posts by going to to www.example.com/investigator (if you are prefixing properly you'll need a slug re-write in your CPT plugin or else it will be www.example.com/mi_investigator)

Wordpress will load them in the same fashion that it loads blog posts archives (archive.php from your theme template)

when you click on any of the posts wordpress loads that investigator content to the single.php template.

Now to customize the output for either the archive or the single pages, there is no need to create an individual page.

You just need to create 2 php files (can be based on the similar files in your parent theme) and put them in your child theme directory. These files will be in your case archive-mi_investigator.php and single-mi_investigator.php (notice that all i did was copy the single.php from my parent theme and place it in my child theme directory, then rename it to single_"name of cpt".php. Same for archive)

whatever changes you make to these files will be shown when you load ANY investigator page.

2 other points. Before those pages work if the plugin or manner that you created the CPT in doesn't do a flush on permalinks, you'll have to manually do it by going to settings/permalinks and clicking save)

3 for the color variations, load a new field in ACF and have the color options there then assign a class to the main div in your single php that has a css bg, font-color, etc associated with it. BAM!

Please mark as answered if this helps! (checkbox) I'd appreciate it!

8
  • Thanks for the response. I think I understand what you are saying with the first option. I am trying to stay away from visual composer. Part of the problem is most of the pages the users will create themselves. Here is the screenshot of the deisgn dropbox.com/s/avqcunszm0hoyy0/nrel-2016indd.jpg?dl=0
    – user5288
    Sep 29, 2016 at 12:40
  • also rudtek how would that work with over 40 different investigators?
    – user5288
    Sep 29, 2016 at 13:19
  • it would work great. the image you sent would be the archive page. clicking name image etc would take you to the investgator-single. visual composer was just an example but you can call it in your template php pretty easily if it is already in your template and clients wouldn't have to interact with it.
    – rudtek
    Sep 29, 2016 at 14:45
  • so each of the investigators would have different color palette, navigation and so on, the problem is how do I set that up for each one without having to greate and single.php everytime and have the user be able to generate it. I was thinking I could do a parent page design but how do I get the child pages to pickup from parent.
    – user5288
    Sep 29, 2016 at 14:59
  • see notes above.
    – rudtek
    Sep 29, 2016 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.