• I am trying to adjust how my images are being displayed on my blog’s blurbs on my website, the theme support gave me this instruction –

    “To make the change in a child theme, add the following to a file named functions.php inside the child theme’s directory:

    <?php
    
    function my_custom_thumbnail_height($height) {
    
       $height = '9999';
       return $height;
    }
    add_filter( 'et_pb_blog_image_height', 'my_custom_thumbnail_height' );
    
    ?>

    so when i go to my child theme editor, i have this for my functions.php –

    <?php
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit;
    
    // BEGIN ENQUEUE PARENT ACTION
    // END ENQUEUE PARENT ACTION

    I tried adding what they told me at the end of this, and my whole site went blank. I disabled the childtheme and reinstalled it created a new one. Any idea of where I have gone wrong in this? I am not at all experienced in using child themes, I am using Child Theme Configurator plug in by Lillea. Thanks

Viewing 1 replies (of 1 total)
  • If you just cut-and-paste’d that code, then I would believe that you’d have that error from having the second opening PHP tag in there.

    <?php
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit;
    
    // BEGIN ENQUEUE PARENT ACTION
    // END ENQUEUE PARENT ACTION
    
    <?php  // - THIS IS WHERE THE PROLBEM IS!
    
    function my_custom_thumbnail_height($height) {
    
       $height = '9999';
       return $height;
    }
    add_filter( 'et_pb_blog_image_height', 'my_custom_thumbnail_height' );
    
    ?>

    The opening and closing PHP tags can only be set in the right places, and if you try to add in an opening tag where it’s not meant to be, you will get that sort of error.

Viewing 1 replies (of 1 total)
  • The topic ‘editing functions.php in child theme’ is closed to new replies.