Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1210422
    fervanrijswijk
    Participant

    I’ve downloaded the newest theme x, and the child theme. Inside the childtheme there is an output.php, but this file does not get overridden. Do I need to do something to activate this file?

    #1210543
    Jade
    Moderator

    Hi there,

    To override the template, you will have to edit the files and place them in /wp-content/themes/x-child/framework/views directories.

    Hope this helps.

    #1215151
    fervanrijswijk
    Participant

    Yes, i copied it to:
    wp-content/themes/x-child/framework/views/global/_admin/customizer/output.php

    but it doesn’t work

    #1215184
    fervanrijswijk
    Participant

    This file should be overridden, so i placed this past and file in x-child
    wp-content/themes/x-child/framework/functions/global/admin/customizer/output.php

    #1215523
    Rue Nel
    Moderator

    Hello There,

    Thanks for updating in! Your child theme function override may not work because the child theme is more of a template override and not a functions file override. Please keep in mind that only the files in the views folder can be overridden with template customizations. Please see our knowledge base on the customization best practices: https://community.theme.co/kb/customization-best-practices/

    What have you change or may have added on the file? Could please post it in your next reply?

    Thank you.

    #1217866
    fervanrijswijk
    Participant

    Thanks for your response. I would like to customize the backstrecth. It does not do what I want

    #1218457
    Rad
    Moderator

    Hi there,

    Overriding functions is different from templates. That one is a function file.

    If you wish to override it then please add this code to your child theme’s functions.php

    function x_customizer_output_js_custom() {
    
      $x_custom_scripts                     = x_get_option( 'x_custom_scripts' );
      $entry_id                             = get_queried_object_id();
      $x_entry_bg_image_full                = get_post_meta( $entry_id, '_x_entry_bg_image_full', true );
      $x_entry_bg_image_full_fade           = get_post_meta( $entry_id, '_x_entry_bg_image_full_fade', true );
      $x_entry_bg_image_full_duration       = get_post_meta( $entry_id, '_x_entry_bg_image_full_duration', true );
      $x_design_bg_image_full               = x_get_option( 'x_design_bg_image_full' );
      $x_design_bg_image_full_fade          = x_get_option( 'x_design_bg_image_full_fade' );
    
      ?>
    
      <?php if ( $x_custom_scripts ) : ?>
    
        <script id="x-customizer-js">
          <?php echo $x_custom_scripts; ?>
        </script>
    
      <?php endif; ?>
    
      <?php if ( $x_entry_bg_image_full ) : ?>
    
        <?php
        $page_bg_images_output = '';
        $page_bg_images        = explode( ',', $x_entry_bg_image_full );
        foreach ( $page_bg_images as $page_bg_image ) {
          $page_bg_images_output .= '"' . $page_bg_image . '", ';
        }
        $page_bg_images_output = trim( $page_bg_images_output, ', ' );
        ?>
    
        <script>jQuery.backstretch([<?php echo $page_bg_images_output; ?>], {duration: <?php echo $x_entry_bg_image_full_duration; ?>, fade: <?php echo $x_entry_bg_image_full_fade; ?>});</script>
    
      <?php elseif ( $x_design_bg_image_full ) : ?>
    
        <script>jQuery.backstretch(['<?php echo x_make_protocol_relative( $x_design_bg_image_full ); ?>'], {fade: <?php echo $x_design_bg_image_full_fade; ?>});</script>
    
      <?php endif;
    
    }
    
    add_action( 'wp_footer', 'x_customizer_output_js_custom', 9999, 0 );
    
    add_action( 'init', 'remove_x_customizer_output_js', 9999, 0 );
    function remove_x_customizer_output_js () {
    remove_action( 'wp_footer', 'x_customizer_output_js', 9999, 0 );
    }

    Hope this helps.

    #1273656
    fervanrijswijk
    Participant

    Thanks! this worked for me 🙂

    #1274015
    Friech
    Moderator

    We’re delighted to assist you with this.

    Cheers!

  • <script> jQuery(function($){ $("#no-reply-1210422 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>