WordPress.org

Ready to get started?Download WordPress

Forums

Problems with functions.php child file (3 posts)

  1. Jean_BAB
    Member
    Posted 10 months ago #

    Hi everyone,

    I'm using a child theme to work with my Explorable wordpress theme (by Elegant Themes).
    I tried to create a functions.php file and add some lines:

    * To modify a bit my YARPP plugin
    * To modify my user profil page by adding three fields:
    - Twitter
    - Linkedin
    - Public email

    My codes are working pretty well when I'm testing it with Wampserver. But when I put my code on the internet, I get this message for the Yarpp line:

    Fatal Error : Call to unidentified function phpadd_image_size() in /homez.744/moi/www/wp-content/themes/Explorable-child/functions.php on line 1

    and my fields won't appear on my user profil page, so I couldn't fill them (pretty logic...) !!!!! *mad*

    My functions.php file:

    <?php
    
    add_image_size( 'yarpp-thumbnail', 110, 110, true ); // Définir la largeur puis la hauteur des thumbnails de YARPP
    
    /*
    #### Big thanks Aky Joe for its tut! ####
    Email: akyjoe@thecreatology.com
    Edit Custom Author Fields
    */
    
    function extend_author_profile_twit( $twitfields )
    {
    $twitfields['twitter'] = 'Twitter';
    return $twitfields;
    }
    add_filter('user_contactmethods','extend_author_profile_twit',10,1);
    
    function extend_author_profile_linkin( $linkinfields )
    {
    $linkinfields['linkedin'] = 'LinkedIn';
    return $linkinfields;
    }
    add_filter('user_contactmethods','extend_author_profile_linkin',10,1);
    
    function extend_author_profile_publicmail( $publicmailfields )
    {
    $publicmailfields['publicmail'] = 'Mail <em>(public)</em>';
    return $publicmailfields;
    }
    add_filter('user_contactmethods','extend_author_profile_publicmail',10,1);
    
    ?>

    Could some one help me please?

    Thanks a lot,

    Jean.

  2. bcworkz
    Member
    Posted 10 months ago #

    Try adding add_theme_support( 'post-thumbnails' ); before the call to add_image_size(). I believe it is required to add sizes even if you are not using featured images or post thumbnails. I'm just guessing, I'm not sure that is the problem.

  3. Jean_BAB
    Member
    Posted 10 months ago #

    Pb solved.

    I put my code in the functions.php of my theme, not in my child theme.

    Thank you for your help ;)

    Best regards,

    Jean.

Reply

You must log in to post.

About this Topic