Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #998700
    martinezg
    Participant

    Hi,

    I’ve been doing many changes to my parent theme and realised I should duplicate it to a child theme. I’ve done so in this path by copying the entire X folder and renaming it: wp-content/themes/x-child

    However, buttons using HTML in cornerstone are not being displayed with this child theme. Screenshot attached.

    Why is that and how to resolve it? I just be an exact replica of the parent theme

    #998701
    martinezg
    Participant

    screenshot

    #998705
    martinezg
    Participant

    here is what is should display

    #998736
    martinezg
    Participant
    This reply has been marked as private.
    #998880
    Friech
    Moderator

    Hi There,

    Thanks for writing in! Sorry I am not entirely certain about the button issue, please clarify. But I advice that you re-install the X|Theme first to make sure that your parent theme is back to default state (no modification).

    And then download the Child theme here and move all your custom templates in it, and upload it to your site.

    Let us know how it goes. Cheers!

    #1000692
    martinezg
    Participant

    That doesnt help. My parent theme has modifications I need to keep.

    What part is not clear?

    #1000708
    martinezg
    Participant

    I should be able to make a copy of my parent theme and have it as a child right??

    #1000768
    martinezg
    Participant

    I’ve followed the steps and dowloaded the X-child theme. Does this mean I can still edit the php files in the X theme folder and any updates won’t apply?

    #1000867
    Rue Nel
    Moderator

    Hello There,

    Please copy all your custom functions to your child theme’s functions.php file. If you have modified any template, you need to transfer to the child theme too!

    You should not be editing any of the php files in the parent theme. Having a child theme will allow you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Hope this helps.

    #1002998
    martinezg
    Participant

    great, thanks!

    #1003016
    martinezg
    Participant

    It seems like adding any code to the child theme’s function.php breaks the entire site. This is what I’m trying to add

    <?php
    
    // =============================================================================
    // FUNCTIONS.PHP
    // -----------------------------------------------------------------------------
    // Overwrite or add your own custom functions to X in this file.
    // =============================================================================
    
    // =============================================================================
    // TABLE OF CONTENTS
    // -----------------------------------------------------------------------------
    //   01. Enqueue Parent Stylesheet
    //   02. Additional Functions
    // =============================================================================
    
    // Enqueue Parent Stylesheet
    // =============================================================================
    
    add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );
    
    // Additional Functions
    // =============================================================================
    
    //function to shorten freshness display from say '1 month, 2 weeks' to '1 month'
    function short_freshness_time( $output) {
    $output = preg_replace( '/, .*[^ago]/', ' ', $output );
    return $output;
    }
    add_filter( 'bbp_get_time_since', 'short_freshness_time' );
    add_filter('bp_core_time_since', 'short_freshness_time');
    
    function remove_counts($output) {
     $output = '';
    return $output;
    }
    add_filter('bbp_get_forum_author_display_name', 'remove_counts' );
    
    function custom_bbp_show_lead_topic( $show_lead ) {
      $show_lead[] = 'true';
      return $show_lead;
    }
    add_filter('bbp_show_lead_topic', 'custom_bbp_show_lead_topic' );
    
    add_filter ( 'bbp_get_reply_post_date', ntwb_bbpress_enable_date_translation, 10, 6);
    add_filter ( 'bbp_get_topic_post_date', ntwb_bbpress_enable_date_translation, 10, 6);
    function ntwb_bbpress_enable_date_translation( $result, $reply_id, $humanize, $gmt, $date, $time ) {
    	$date = get_post_time( get_option( 'date_format' ), $gmt, $reply_id, $translate = true );
    	$result = sprintf( _x( '%1$s', 'date at time', 'bbpress' ), $date, $time );
    	return $result;
    }
    
    function bm_bbp_no_breadcrumb ($param) {
    return true;
    
    }
    add_filter ('bbp_no_breadcrumb', 'bm_bbp_no_breadcrumb');
    
    // show admin bar only for admins
    if (!current_user_can('manage_options')) {
    	add_filter('show_admin_bar', '__return_false');
    }
    add_filter( 'wp_nav_menu_items', 'autov_add_loginout_navitem', 10, 2 );
    function autov_add_loginout_navitem( $items, $args ) {
    	if( $args->theme_location == 'primary' ){
    		$login_item = '<li class="login">'.wp_loginout($_SERVER['REQUEST_URI'], false).'</li>';
    		$items .= $login_item;
    	}
    	return $items;
    }
    #1003021
    martinezg
    Participant

    never mind. I had to remove it from the parent theme first

    #1003030
    Thai
    Moderator

    Glad you’ve sorted it out.

    If you need anything else, please let us know 🙂

    #1003039
    martinezg
    Participant

    Sorry for the multiple messages. I have 1 more thing. I copied the x/framework/css folder to my child theme but it seems like my site is still using the parent theme ones. How can that be changed?

    #1003083
    Thai
    Moderator

    Hi @martinezg,

    All your custom CSS should be placed under style.css file in your child theme.

    You don’t have to copy the CSS files from the parent theme to child theme.

    Regards!

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