Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #68255
    Jimtowner
    Participant

    I just upgraded to CatchBox 3.9 and the templates directory has disappeared. I was using it for a couple of custom php files for a critical plugin which is vital to our site. Please tell me where to store the php so that customization works.

    I understand that child themes is the way to go but frankly that is beyond the pay grade of anyone working with our non-profit. In the past it has not been a problem with updating CatchBox and quickly reinstalling the php in the templates folder. We want to continue doing that.

    Thanks

    #68272
    Sakin
    Keymaster

    @Jimtowner: You shouldn’t edit/add files inside theme directory catch-box. As all the files and folders will be reverted back to original when you update theme theme. This is done automatic by WordPress and we don’t have any control on it. So, we recommend you to build child theme and then add/edit files. In parent theme, you should only edit using Theme Options, Widgets and Menus.

    Building child theme is free of cost. You can read about it and download it from http://catchthemes.com/blog/create-child-theme-wordpress/

    #68301
    Jimtowner
    Participant

    Thanks Sakin. I read the instructions but I still don’t understand what to do with the custom php files that our site uses. I copied one of the below. Should the contents of that file be copy and pasted into functions.php or does it go somewhere else and if so, where?

    filename: pdf-record-custom.php

    <?php
    /*
     * default template for the [pdb_record] shortcode for editing a record on the frontend
     *
     * this template uses a table to format the form
     * 
     * @version Participants Database 1.6
     */
    ?>
    <div class="wrap <?php echo $this->wrap_class ?>">
    
      <?php
      /*
       * as of version 1.6 this template can handle the display when no record is found
       * 
       * 
       */
      if (!empty($this->participant_id)) : 
        
      ?>
    
      <?php // output any validation errors
     $this->print_errors(); ?>
      
      <?php // print the form header
      $this->print_form_head()
      ?>
      
      <?php while ($this->have_groups()) : $this->the_group(); ?>
        <?php $this->group->print_title() ?>
        <?php $this->group->print_description() ?>
    
        
        <table  class="form-table">
          
          <tbody class="field-group field-group-<?php echo $this->group->name ?>">
    
          <?php
          // step through the fields in the current group
          
            while ($this->have_fields()) : $this->the_field();
              ?>
          
          <tr class="<?php $this->field->print_element_class() ?>">
          
            <th for="<?php $this->field->print_element_id() ?>"><?php $this->field->print_label() ?></th>
            <td>
                      
                  <?php if ($this->field->has_help_text()) : ?>
              <span class="helptext"><?php $this->field->print_help_text() ?></span>
              <?php endif ?>
              <?php $this->field->print_element_with_id(); ?>
              
            </td>
            
          </tr>
          
          <?php endwhile; // field loop ?>
          
          </tbody>
    
        </table>
        
      <?php endwhile; // group loop ?>
        <table class="form-table">
          
        <tbody class="field-group field-group-submit">
    
          <tr>
            <th><h3><?php $this->print_save_changes_label() ?></h3></th>
            <td class="submit-buttons">
              <?php $this->print_submit_button('button-primary'); // you can specify a class for the button, second parameter sets button text ?>
            </td>
          </tr>
          
        </tbody>
    
        </table><!-- end group -->
      
      <?php $this->print_form_close() ?>
      
        <?php else : ?>
        
        <?php 
        /*
         * this part of the template is used if no record is found
         */
        echo empty(Participants_Db::$plugin_options['no_record_error_message']) ? '' : '<p class="alert alert-error">' . Participants_Db::plugin_setting('no_record_error_message') . '</p>'; 
        ?>
        
        <?php endif ?>
      
    </div>
    #68323
    Sakin
    Keymaster

    @Jimtowner: That is simple. First, just download sample Catch Box child theme from http://catchthemes.com/blog/create-child-theme-wordpress/ and then create file in your file pdf-record-custom.php in your child theme with your codes.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘HELP–where did the templates directory go?’ is closed to new replies.