• Resolved MRM-Racing

    (@mrm-racing)


    After the upgrade of customizr i understand the importance of proper customization.

    I had copied some classes since I did not know how to add them in function.

    So if I have this in class-header-header_main.php;

    $logo_class = apply_filters( ‘tc_logo_class’, ‘brand span3’ );

    And manually changed to ;

    $logo_class = apply_filters( ‘tc_logo_class’, ‘brand span1’ );

    How would I write that in functions?

    I also changed basic size so this in function may work?

    add_filter( ‘slider_full_size’, ‘my_slider_full_size’);
    function my_slider_full_size() {
    $sizeinfo = array( ‘width’ => 1800 , ‘height’ => 1300, ‘crop’ => false );
    return $sizeinfo;
    }

    Sorry this seems for sure basic for you but I have not done any php yet.

    But will start to learn and customize in the right way ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • About change image sizes:
    https://www.themesandco.com/snippet/changing-default-image-sizes-customizr/

    About the logo, you don’t need to copy that class, filters are there to avoid that.
    The only thing you have to do is use that hook filter in you child-theme functions.php.

    add_filter('tc_logo_class', 'my_logo_class');
    function my_logo_class($original){
        return 'brand span1';
    }

    or if you prefer
    return str_replace('span1', 'span3', $original);

    Hope this helps.

    p.s.
    browse in code snippets and tutorial on https://www.themesandco.com/, you will find a lot of useful stuff, and you can understand how to properly customize customizr easily. ??

    Thread Starter MRM-Racing

    (@mrm-racing)

    And it works!

    Look into snippets code is the best way to learn, and I am planning more sites with this grate theme!

    Thread Starter MRM-Racing

    (@mrm-racing)

    One last question ??

    I have removed Social block and tagline block from header, so how should I write the filter to do same as remove them from the class?

    function tc_social_in_header($resp = null) {
    //class added if not resp
    $social_header_block_class = apply_filters( ‘tc_social_header_block_class’, ‘span5’, $resp );
    $social_header_block_class = (‘resp’ == $resp) ? ”: $social_header_block_class ;

    $html = sprintf(‘<div class=”social-block %1$s”>%2$s</div>’,
    $social_header_block_class,
    ( 0 != tc__f( ‘__get_option’, ‘tc_social_in_header’) ) ? tc__f( ‘__get_socials’ ) : ” );
    echo apply_filters( ‘tc_social_in_header’, $html, $resp ); }

    How would the code look to remove the hook since it forces menu away…

    …and thanks again!

    Thread Starter MRM-Racing

    (@mrm-racing)

    Tried this but it did not work ??

    remove_filter( ‘tc_social_header_block_class’, ‘wpautop’ );

    what is ‘wpautop’ ?
    For social block you just need to uncheck the proper option in customizr settings.
    About tagline:

    add_action('wp_head', 'remove_tagline');
    function remove_tagline(){
        remove_action ( '__header', array( TC_header_main::$instance , 'tc_tagline_display' ) , 20); //if you want to remove it also in mobiles
        remove_action ( '__navbar', array( TC_header_main::$instance , 'tc_tagline_display' ) , 20);
    }

    should work.

    Thread Starter MRM-Racing

    (@mrm-racing)

    For social block you just need to uncheck the proper option in customizr settings.

    Yes they do not show up but still take place, this shows up in firebug; <div class=”social-block span5″></div>

    So I actually have to remove it.

    And ‘wpautop’ was from google ?? Did not know what it was.

    wpautop is a common problem on other Themes where extra <br> and <p> tags are generated that damages the site layout.

    Can be removed by adding this to Child Theme functions.php:

    //Remove <p> <br> tags
    remove_filter( 'the_content', 'wpautop' );
    remove_filter( 'the_excerpt', 'wpautop' );

    Ah I see..
    about social block, in that function above add also:
    remove_action('__navbar', array( TC_header_main::$instance , 'tc_social_in_header' ) , 10);

    well the priority is an optional in these cases.

    Thread Starter MRM-Racing

    (@mrm-racing)

    Many thank’s, works like it should!! Grate community ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Proper customization’ is closed to new replies.