Viewing 15 replies - 1 through 15 (of 15 total)
  • Well, when you use a copy of core files in your child-theme you have to consider to maintain those according to the parent theme changes…

    Thread Starter jrothra

    (@jrothra)

    d4z_c0nf – That isn’t helpful but, honestly, is a bit condescending. I want to know what to do to get the meta info layout the way I want after the latest update. Since I’m not a coder (cf. above referenced thread) I’m not sure what to do.

    Hi jrothra,
    you’re right and I’m sorry if gave you that impression, but the thing is that looking at the title seems that Customizr conflicts with something, and isn’t so. So I wanted to say that isn’t a Customizr issue. Is something you changed in the child-theme and a theme shouldn’t be considered responsible of that. That topic title is pretty alarming.. I think you’ll agree on this.. The title should be “My hacks conflict with Customizr 3.3.1”.
    I understand you’re not a developer, but you made something as a developer, and you’ll often be subject to this kind of problems. Can’t you port your changes to the new class_content_post_metas.php ?

    Thread Starter jrothra

    (@jrothra)

    No problem. I can try doing this. However, I’m sure it’d be easier (and more advisable) to make the changes via the child theme’s functions.php and/or css file. However, since I’m not a coder, I’m not sure what to add to the functions.php file. I did find this one, but it doesn’t work in 3.3: https://themesandco.com/snippet/remove-post-meta-details/

    Hi @jrothra
    Woudl you try to setup a child-theme and add the following code to its functions.php ?

    $_category_list = '';
    $_tag_list = '';
    add_filter('tc_category_list', 'post_cat_list');
    function post_cat_list( $cats ){
        global $_category_list;
        $_category_list = $cats;
        return $cats;
    }
    add_filter('tc_tag_list', 'post_tag_list');
    function post_tag_list( $tags ){
        global $_tag_list;
        $_tag_list = $tags;
        return $tags;
    }
    add_filter( 'tc_meta_utility_text', 'my_meta_utility_text', 20 );
    function my_meta_utility_text($meta){
        global $_category_list, $_tag_list;
        $_utility_text = '<span class="by-author"> By %4$s</span> on %3$s';
        $_utility_text =  $_category_list ? $_utility_text = $_utility_text . '<br />Category: '. $_category_list : $_utility_text;
        $_utility_text =  $_tag_list ? $_utility_text = $_utility_text . ' | Tags: ' . $_tag_list : $_utility_text;
    
        return $_utility_text;
    }

    Cheers

    Thread Starter jrothra

    (@jrothra)

    d4z_c0nf — sorry for the delayed reply. I just tried that and it worked. Thank you! BTW, I already had a child theme ??

    I jrothra.
    Glad to hear that, anyway as I told you, since cutomizr evolves continuously, I cannot ensure this will work forever, so if you’ll have problem with the next updates.. let me know ??

    Thread Starter jrothra

    (@jrothra)

    Forgot to change the status to solved. Did that now.

    Hi jrothra,
    you’re pretty unfortunate with this code ??
    In the Customizr versions > 3.3.1 the code above will not work, so when you’ll update the theme, replace the code above with this one:

    add_filter( 'tc_post_author_metas_html', 'my_author_metas_html', 20, 2);
    function my_author_metas_html( $html, $_auth = '' ){
      if ( empty($_auth) )
        return $_html;
      return sprintf( '<span class="by-author">%s %s</span>' , __('By' , 'customizr'), $_auth );
    }
    
    add_filter( 'tc_post_tax_metas_html', 'my_tax_metas_html', 20, 2);
    function my_tax_metas_html( $html, $_tax = array() ){
      if ( empty($_tax) )
        return $_html;
      //extract "_show_cats" , "_show_tags" , "cat_list", "tag_list"
      extract($_tax);
      $cat_list = ! empty($cat_list) && $_show_cats ? sprintf( '<br />%s %s' , 'Category:' , $cat_list ) : '';
      $tag_list = ! empty($tag_list) && $_show_tags ? sprintf( '%s %s %s' , ! empty( $cat_list) ? ' |' : '', 'Tags: ' , $tag_list ) : '';
      return sprintf( '%s%s' , $cat_list, $tag_list );
    }
    add_filter( 'tc_set_metas_content', 'my_metas_content', 20, 2);
    function my_metas_content( $_html, $_parts){
      if ( empty($_parts) )
        return $_html;
    
      //extract $_tax_text , $_date_text, $_author_text, $_update_text
      extract($_parts);
    
      return sprintf( '%3$s %1$s %2$s %4$s' , $_date_text, $_tax_text , $_author_text, $_update_text );
    }

    Thread Starter jrothra

    (@jrothra)

    I’m running Customizr 4.1.1 on johnrothra.com and the first code you posted worked well. Now I’m confused. Unfortunate? *scratching head*

    E.g., https://www.johnrothra.com/devotionalteaching/christian-living/the-temple-churches-and-walking-israels-sinful-path/

    Customizr 4.1.1 doesn’t exist yet ??
    You’re running customizr 3.3.1
    When you’ll update to a new Customizr version (> 3.3.1 means: greater than 3.3.1) you have to replace the first code with the second one.
    Hope this helps.

    Thread Starter jrothra

    (@jrothra)

    Ah, my bad. I misread the info… it’s WP 4.1.1. 2:30 AM must be getting to me.

    Ehehe, yeah time to sleep then ??
    Good night.

    Thread Starter jrothra

    (@jrothra)

    Just updated to Customizr 3.3.8 and changed the code as you mentioned. Works like a dream! Thank you!

    you’re welcome ??

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Customizr 3.3.1 Conflicts with Custom Post Metas’ is closed to new replies.