How to create repeated post mechanism

How to create a mechanism where a single blog post can be used multiple times in different courses exactly like the site networklessons.com.

for example
https://networklessons.com/cisco/ccna-routing-switching-icnd2-200-105/introduction-to-ipv6/
https://networklessons.com/cisco/ccna-routing-switching-icnd1-100-105/introduction-to-ipv6/
https://networklessons.com/cisco/ccnp-route/introduction-to-ipv6/
https://networklessons.com/cisco/ccie-routing-switching/introduction-to-ipv6/

the above is a single lesson used in multiple courses.
i want to use the exact same mechanism for my site.

Regards

  • Adam Czajczyk

    Hello Zubair

    I hope you're well today and thank you for your question!

    I don't have full insight to that example site but it looks like they're not even using any "e-learning" solution for this. The setup seem quite pretty straight-forward though and I think it could quite easily be achieved in a way similar to described below:

    - a very well planned structure of categories and and their child-categories
    - a single post that's just categorized in multiple categories
    - for example: "Cisco" would be a parent category and "CCIE R&S Lab" as well as "ICDN2 200-105" would be its child categories

    - then with custom templates for category archive pages posts within give category can be nicely organized, giving an impression that the post is "reused" while it's just the same single post but in two categoreis

    - they also seem to be using a plugins similar to Conditional Menu to alter menus accordingly to the "course" and a membership plugin (our Membership 2 Pro would do the job well) to protect access to some parts of the site for members only.

    I think that's not that complex and actually I'd just start with creating e.g. a category for the set of courses, then sub-categories (that would be specific courses) within it and then just categorize posts (lessons) with these categories.

    To make it even more robust (and I believe they do that to) I'd just go for custom posts rather than regular posts but the principle would be the same.

    I realize that's quite a "general" advice but it should give you a solid idea for further research. If you got any additional questions on this, let me know please (and possibly maybe a bit more details on your goals) and I'll be happy to assist you further.

    Kind regards,
    Adam

  • Zubair

    Thanks Adam for the detailed reply.

    please clarify the lines i am quoting below, and how to achieve this if you break it into steps.

    "then with custom templates for category archive pages posts within give category can be nicely organized, giving an impression that the post is "reused" while it's just the same single post but in two categories".

    one more thing, using menu override or conditional menu plugin. when i use that plugin i will assign custom menu for every post. so in my case when a post is in two different courses how will it work because it will only respond to assignment of a single custom menu instead of working with two menus.
    for example i have post A in two categories, i want it in two courses C1 and C2, for C1 i want to show menu M1 and for C2 i want to show menu M2, in this case i can only assign one menu to my post A. how to deal with this.

    Regards

  • Predrag Dubajic

    Hi Zubair,

    please clarify the lines i am quoting below, and how to achieve this if you break it into steps.

    "then with custom templates for category archive pages posts within give category can be nicely organized, giving an impression that the post is "reused" while it's just the same single post but in two categories".

    This would require some custom development as you would need to create custom archive templates and adjust them to your liking.
    You can use different templates by having different files for your categories, they would need to look like this category-ID.php or category-PHP.php.
    Best way to do this is to create a child theme, then copy category.php from your parent theme to child theme and there rename it as mentioned above and add your custom code.
    You can read more about category templates here:
    https://codex.wordpress.org/Category_Templates

    one more thing, using menu override or conditional menu plugin. when i use that plugin i will assign custom menu for every post. so in my case when a post is in two different courses how will it work because it will only respond to assignment of a single custom menu instead of working with two menus.
    for example i have post A in two categories, i want it in two courses C1 and C2, for C1 i want to show menu M1 and for C2 i want to show menu M2, in this case i can only assign one menu to my post A. how to deal with this.

    I'm not sure if there's a plugin that will do this for you but editing your header.php and adding some conditions should be possible here.
    You would also need to copy this file to your child theme folder first and then edit it there.
    If your theme has an option to register different menus you can use that, if not you will need to register new ones yourself, you can find instructions for that here:
    https://premium.wpmudev.org/blog/add-menus-to-wordpress/

    After that you can use conditions in header.php to call different menus based on the category, something like this:

    if ( is_category( 'C1_ID' ) ) {
    
    	//...Your code for menu 1
    
    } elseif ( is_category( 'C2_ID' ) ) {
    
    	//...Your code for menu 2
    
    } else {
    
    	//...Your default menu code
    
    }

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.