This study addresses the growing need for sustainable and personalized learning solutions in online education by optimizing cross-course learning paths. With the increasing volume of e-learning resources, students often struggle to select appropriate courses and learning paths that align with their individual abilities and goals. A novel cross-course learning path planning model is proposed, which integrates resources from multiple courses using modified matching functions based on Item Response Theory (IRT) and a knowledge graph. This model effectively matches learner attributes, such as abilities, learning styles, and goals, with material attributes like difficulty, types, and prerequisites. An innovative variable-length continuous representation (VLCR) and an improved differential evolution algorithm are employed to optimize the multi-attribute matching (MAM) model, enhancing learning personalization. Results from numerical experiments indicate that cross-course learning paths significantly enhance learning outcomes for a wide range of learners, with over 45% benefiting from improved matches compared to single-course paths. Additionally, 70% of learners experienced similar or better results with cross-course learning. This approach not only promotes efficient learning but also supports sustainable educational practices, preparing educators and learners to meet the challenges of a rapidly changing world.