• Resolved litbea

    (@litbea)


    Hi again!

    I’ve found that the popup-window-signup.php and other templates need some modification to allow PO file to work, like changing ‘cp’ to ‘coursepress’.

    As this file isn’t located in the normal /wp-content/themes/coursepress folder but in /wp-content/plugins/coursepress/includes/templates, where should I put my modified version to be recognized by a child theme?

    Regards,
    Eduardo

    https://www.ads-software.com/plugins/coursepress/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Hey there Eduardo,

    Hope you’re well today!

    If you’re looking to create a child theme from coursepress theme you can simply create a regular child theme, create functions.php file and add the following there:

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ) );
    }

    With this you should be able to place those template files in your child theme and have them working.

    Hope this helps ??

    Best regards,
    Bojan

    Thread Starter litbea

    (@litbea)

    Hi Bojan, thanks for the info!

    I’ve tried adding your function to my already existing functions.php file, but had still no luck.

    For example, must child popup-window-signup.php template be located in the same folder as the functions.php file or inside /templates child folder? I’ve tried both but still nothing ??

    Have a nice day.

    Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Hey again,

    Sorry I never checked this up until now.

    popup-window-signup.php is a template file from CoursePress plugin not a CoursePress theme which is the reason this is not working.

    We can use filter in your child theme functions.php to tell him which file to use. Please try adding the following to your child theme functions.php:

    add_filter(‘coursepress_signup_steps’, ‘modify_coursepress_signup_steps’, 10, 1);

    function modify_coursepress_signup_steps($array){
    $array['signup'] = array(
                       'action' => 'template',
                       'template' => get_stylesheet_directory() . '/new-popup-window-signup.php',//path to child theme's file
                       'on_success' => 'process_signup',
                   );
    }

    After that copy the template to your child theme and make what ever modifications you want.

    Hope this helps ??

    Cheers,
    Bojan

    Thread Starter litbea

    (@litbea)

    Thanks again for your quick answer, but it’s not working for me. I’ve inserted both add_filter and function to my functions.php and then the popup opens, there the animation while waiting, but no content is loaded inside the lightbox.

    Could I insert some debug info inside the function to show the full path it is trying to load, like print_r(array_values($array[‘signup’])); ?

    Regards
    Eduardo

    Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Hey Eduardo,

    Sorry about this, please replace the second filter with this one:

    add_filter('coursepress_signup_steps', 'modify_coursepress_signup_steps', 10, 1);
    
    function modify_coursepress_signup_steps($array){
    $array['signup'] = array(
                       'action' => 'template',
                       'template' => get_stylesheet_directory() . '/new-popup-window-signup.php',//path to child theme's file
                       'on_success' => 'process_signup',
                   );
    
    return $array;
    }

    And also make sure your new file is called new-popup-window-signup.php.

    Best regards,
    Bojan

    Thread Starter litbea

    (@litbea)

    Solved!

    Thanks a lot.

    Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Glad I could help and have a great weekend! ??

    Cheers,
    Bojan

    Thread Starter litbea

    (@litbea)

    Hi again:

    I need to modifu another template, student-dashboard.php. What filters should I include?

    Regards,
    Eduardo

    Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Hey again Eduardo,

    student-dashboard.php should work in your child theme out of a box so no additional filters needs to be included for this one.

    The only concern here is that template is being called as a template part in the content so you’ll need to wrap up the template with header, footer and proper page holders if that makes sense.

    Best regards,
    Bojan

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Where to put child templates from’ is closed to new replies.