Codeless
  • Support Home
  • Themes
  • Support
  • WordPress Tutorials
    • How to Start a Blog
    • Best Website Builders
    • Best Small Business Hosting
    • Email Marketing Services
    • Cheap WordPress Hosting
  • Video Tutorials

Community Forums

Using /js/main.js in Child Theme

    • 9 years, 10 months ago rmiller
      Participant

      Expired

      Hello,

      I have modified my js/main.js file so that I can increase the testimonial duration as per your KB article, however I need this to be reflected in the child theme folder so that as new theme updates are available, my adjustments are not overwritten. I copied the file to specular-child/js/main.js, however when viewing the site, it’s not reflecting the child themes’ main.js.

      If I am unable to do that, how can I declare this in the child themes functions.php?

      I have found other instances where I have wanted to make adjustments with parent theme files and move to the child theme and it wasn’t possible and I was wondering if it could be possible for you to make an update in the future to the parent theme so that any files found in the child theme overwrite the parent theme.

      Thanks for your time.

    • 9 years, 10 months ago Ruco
      Keymaster

      Hello,

      Sorry for the late response.
      We have added option to change the testimonial and slider speed from the theme. TO change the testimonial speed, edit the testimonial carousel element.

      Please download the latest theme version.

      If you want to register a javascript file in child theme, you can add this code at ‘specular-child/functions.php’

      add_action('wp_enqueue_scripts', 'load_javascript_files');
      function load_javascript_files() {
      	wp_register_script('ajax_call_mkto', get_template_directory_uri() . 'js/main1.js', array('jquery'), true );
      	wp_enqueue_script('ajax_call_mkto');
      }
      

      Then create the file at child theme ‘specular-child/js/main1.js’.

      Best regards!

    • 9 years, 9 months ago rmiller
      Participant

      Expired

      Hi Ruco,

      That’s great that you have added the option in to adjust the speed. Do you have any plans on adding that option to “Testimonial (Cycle)”? That is what I am currently using and would love to have that option.

      Meanwhile, I have updated my child themes functions.php file with the code that you provided to register a javascript file. However, it is currently referencing the parent theme folder instead of the child theme folder. While I could add the file in the parent folder, I would prefer to keep it in the child folder. Is there something else that I need to do so that the child theme folder is referenced?

      Thanks!

Viewing 2 reply threads

You must be logged in to reply to this topic.

Login

Log In
Register

Renew Support

  • Renew Specular Support
  • Renew Tower Support
  • Renew Folie Support
  • Renew Handel Support
  • Renew June Support
  • Renew Picante Support
  • Renew Thype Support
  • Renew Regn Support

Search Forums

Forums

  • Bygge – Construction Theme
  • Converta – Software Theme
  • Folie – The WordPress Website Builder
  • Handel – Responsive Multi-Purpose Business Theme
  • June WooCommerce WordPress Theme
  • Livecast – Podcast Theme
  • Picante – Restaurant & Food WordPress Theme
  • Regn | Agency & Business WordPress Theme
  • Remake – Minimal Portfolio & Agency Theme
  • Specular – Multi-Purpose WordPress Theme
  • Suggest us Features
  • Tower – Business-Driven Multipurpose WP Theme
  • Vibrance – Photography Theme

Site Links

  • Support Policy
  • Specular Support Forum
  • Video Tutorials
  • Knowledge Base
  • Guides and Reviews

Useful Articles

  • Build a Website
  • Web Design & Development
  • Hosting
  • WordPress

Login

Log In
Register Lost Password