Home Forums Themes Support Gecko Child theme and possible core changes to make things a little easier.

Viewing 1 reply thread
  • Author
    Posts
    • #1781

      Hi
      I was wondering if you could assist me with the following query regarding child themes, future updates and potentially adding some changes to the core code to make over riding child themes a little easier without having to make changes to the main theme.
      Effectively I have created a highly customized child theme for a client based on your Gecko theme. But in order to over ride some of the functions and file paths and files I needed to make some core changes to the main theme.
      Which I have noted down so that I can re add them after each update to the main theme. This is obviously a bit tedious.

      So I was wondering if you could look at some of the changes I have suggested and possibly add them to future updates. As well as provide a little insight into the reason for doing certain things so that I can better adapt my code.

      To summarize what I have done and still plan to do is the as follows:

      The main function.php I added support for the new wordpress 4.7 get_theme_file_path() and get_theme_file_uri() which replaced get_template_directory() and get_template_directory_uri() respectively when defining ‘JAS_GECKO_PATH’ and ‘JAS_GECKO_URL’

      I subsequently changed all occurrences of get_template_directory() get_template_directory_uri() in the various core admin and vendor files.

      This allows me to replace a lot of files and js simply by copying the files into my child theme. This reduces the need to de_enque and re_enque files via the child theme function.php which is convenient and reduces the number of php calls etc.  But also allows me to change certain files and functions that I otherwise wouldn’t have been able to without changing them in the parent file, particularly some of the vendor files.

      As a matter of interest is there a reason why you use JAS_GECKO_PATH/ JAS_GECKO_URL in some of the files but then directly call get_template_directory()and get_template_directory_uri() in others. For example action.php uses add_editor_style( get_template_directory_uri() . ‘/assets/css/editor-style.css’ ); but further down you use JAS_GECKO_URL. This is also evident in the cs_framework.php file.

      The reason I ask is that I know adding the new WordPress 4.7 functions will break backwards compatibility unless you add additional code like the example below to the theme so I understand if you are hesitant to do so.
      if(!function_exists(‘get_theme_file_uri’)){
      function get_theme_file_uri( $file = ” ) {
      $file = ltrim( $file, ‘/’ );
      if ( empty( $file ) ) {
      $url = get_stylesheet_directory_uri();
      } elseif ( file_exists( get_stylesheet_directory() . ‘/’ . $file ) ) {
      $url = get_stylesheet_directory_uri() . ‘/’ . $file;
      } else {
      $url = get_template_directory_uri() . ‘/’ . $file;
      }
      return apply_filters( ‘theme_file_uri’, $url, $file );
      }
      }

      But would it not be possible to change out all the places where you have used get_template_directory() and get_template_directory_uri() and replace these with JAS_GECKO_PATH/ JAS_GECKO_URL. (Unless there is a reason you haven’t done so,  then could you let me know so I understand possible issues I could face in future.) This will allow for consistency but also mean that users who wish to use the new WP4.7 functions can simply change the function.php path definitions in the core file. So they only need to change one file when updating.

      Please could you let me know if this is possible or if the theme devs have an email address I can use to discuss it a bit further by way of code examples etc.

      Thanks again for a great theme and look forward to your reply.

    • #1787

      Hi Ckitso,

      Thank you for your suggest.

      We really appreciate your comment and consider this a task to improve our theme in future update.

      Can you give us your suggest codes to our email: [email protected]

      Thanks and have nice day

      Harry
      Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio

Viewing 1 reply thread

You must be logged in to reply to this topic.