Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Custom Post Types in WordPress

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #45941
    andymacleod
    Participant

    I’m a teacher and amateur web designer. On a school site I’ve been making in WordPress, I’ve created a Custom Post Type called Lessons. How do I get the Lesson pages to be child pages of regular pages?

    I want my colleagues to be able to create Lessons and attach them to the right course units, but I want to restrict them from editing regular pages…

    Your help would be appreciated! You can see what I’ve done so far at science.standhigh.info

    #140942
    andymacleod
    Participant

    I should also mention that I am using the Advanced Custom Fields and Custom Post Type UI plugins (as used by Chris in his mobile site development screencasts in The Lodge)

    #140954
    ephoenix
    Member

    I asked a similar question a couple of months ago, but it turned out, that nobody could help me with it. Since then I researched on my own. I found out, that, if you are good with PHP (which I’m not), you probably can pull this off. In my case I just couldn’t get it to work, so I gave up and took another approach.

    I don’t know if this will help you, but you can create an archive for your custom post type. Just create a new template file and name it **archive-“your-custom-post-type”.php** (without the quotation marks). Oh, and make sure to check *has archive* in Custom Post Type UI. You could sort the lessons with custom taxonomies there.
    Or you could create a custom taxonomy for each topic and have your colleagues tag their posts with the right taxonomies. You could then link to a custom taxonomy archive for each lesson/topic (yes, this will probably be a mountain of work ;-) ).

    If that doesn’t help you, here’s the PHP-way (which I couldn’t get to work, but maybe you have more luck/skill): http://www.gravitationalfx.com/how-to-set-a-page-as-the-parent-of-a-wordpress-custom-post-type/

    #140955
    chrisburton
    Participant

    @ephoenix @andymacleod If no one can answer your questions here, you could always use the WordPress forum or the dedicated WordPress section on Stack Overflow.

    http://wordpress.org/support/forum/how-to-and-troubleshooting

    http://wordpress.stackexchange.com

    It might be better if you elaborate on what exactly you’re trying to do, though.

    #140965
    furrycoat
    Member

    Hmm im not sure

    #141016
    ephoenix
    Member

    @chrisburton I did exactly that, and found another way to achieve what I wanted to do.


    @Joe_Temp
    From my understanding of wordpress’ cpt-system, a custom post type can be a page too, you just have to set **’capability_type’ => ‘page’** for that. Correct me if I’m wrong.

    #141029
    andymacleod
    Participant

    Thanks for the replies and ideas. I think the main problem is my lack of understanding about taxonomies…

    I got my single-lessons.php template working yesterday (apart from a repeater-field for file attachments – which I’m reasonably confident I’ll get sorted soon). Got it working now! So the custom taxonomy issue is the main thing I need help with…

    I need my non-technical colleagues to be able to assign a lesson to a particular unit with a single click or select field. There will be about 100 different units of work in a hierarchy of up to 5 levels… So for example, a lesson could be assigned to:

    Science > AS Level Physics > Unit 1 > Section 1

    At the moment, I have no idea how to achieve this!

    Thanks,

    Andy

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Other’ is closed to new topics and replies.