Support for Envato Buyers Forums OldCar Changes to theme_functions

Viewing 3 reply threads
  • Author
    Posts
    • #6579
      rsharpe75
      Member

      Hi,

      I need to make a change to:
      /wp-content/themes/oldcar/includes/theme_functions.php

      I want to remove the author link and editing this file is not a problem but I want to do it in the child theme so that when you release an update, my changes are not affected.

      I copied that file to the child theme (in includes directory) but it does not work. How do I make this change?

      Regards

    • #6582

      Hi

      Don’t copy theme-functions.php file to the child theme, because it’s not a template file.

      You can just create a new functions.php file in the child theme folder, write your own function to override the van_posted_on() function as below.

      /*Post meta info*/
      if( !function_exists( 'child_posted_on') ){
        function child_posted_on(){
      ?>     
         <span class="blog-article-info"><?php printf(__('By %s','OldCar'),get_the_author());?> / <?php printf( __( 'in %2$s', 'OldCar' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?> / <?php the_time(get_option('date_format'));?></span>
      <?php
        }
      }

      Then, copy posts-normal.php and posts-grid.php file to the child theme folder, edit these file, replace van_posted_on() to child_posted_on()

      Thanks

    • #6585
      rsharpe75
      Member

      This worked brilliantly! Thank you very much.

    • #6594

      It’s my pleasure!

Viewing 3 reply threads
  • You must be logged in to reply to this topic.