Skip to:
Content
Pages
Categories
Search
Top
Bottom

Error with profile.php


  • jay7981
    Participant

    @jay7981

    hello all i am getting this error on my site,

    Fatal error: Call to a member function format() on boolean in /usr/www/aacts/public/site/bmmv3/wp-content/themes/blackfyre/buddypress/members/single/profile.php on line 65

    and here is the section with line 65

    <!--age-->
    	            <?php if(get_the_author_meta('age', $a_id) && get_the_author_meta('age', $a_id) != 'none'){ ?>
    
    	            <li><strong><?php esc_html_e('AGE: ','blackfyre');?></strong>
    	                 <?php
                        $age = get_the_author_meta('age', $a_id);
    
                        $age = DateTime::createFromFormat('d/m/Y', $age);
                        $age = $age->format('Y-m-d'); //Line 65
                        $age = floor((time() - strtotime($age)) / 31556926);
                        echo $age; 
             
                    } ?>
    	            </li>
    
    	            <!--age-->
  • You must be logged in to reply to this topic.
Skip to toolbar