-
AuthorPosts
-
September 19, 2014 at 7:01 pm #108417
So I’ve been having some issues with my site, and after talking with my host, they pinpointed the problem to this error log entry in ~/public_html/error_log:
[19-Sep-2014 16:22:36 America/Los_Angeles] PHP Fatal error: Call to undefined function x_google_authorship_meta() in /home2/vigorwor/public_html/wp-content/themes/x-child-renew/Custom Forms/members.php on line 153
I assume that the trouble stems from X’s recent removal of support for Google Authorship, which makes any reference to it obsolete. We paid for a developer to do the custom page templates on our site, and as I know very little about custom html myself, I was wondering if you guys could help remove the problem code from my members.php template. Here’s the full template code:
<?php /* Template Name: Members page */ get_header(); // x child theme hids the admin bar... this hack ovverrides it. ?> <?php //add_user_meta( get_current_user_id(), "hasPurchasedWorkout", "true", true ); //adds a meta value to user profile //var_dump( get_user_meta( get_current_user_id(), "hasPurchasedWorkout", true )); if ( is_user_logged_in() ) { global $current_user; $user_roles = $current_user->roles; $user_role = array_shift($user_roles); if( $user_role == "In_Training_(purchased)" ){ //if user has purchased workout display this global $display_name , $user_email; get_currentuserinfo(); $page_title = $user_email; $post_type = "post"; $output = "OBJECT"; $post = get_page_by_title( $page_title, $output, $post_type ); ?> <div class="x-container-fluid max width offset cf"> <div class="x-main full" role="main"> <h1 class="h-custom-headline mbm center-text h4 accent"><span>Members</span></h1> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-wrap" > <div class="entry-content content"> <a href='http://www.vigorworkouts.com/workouts'> <i class="fa fa-child fa-3x"></i><h3 style="display: inline;">MY WORKOUTS</h3> </a> <br> <a href="http://www.vigorworkouts.com/account-settings-page/"> <i class="fa fa-cog fa-3x"></i><h3 style="display: inline;">My Account Settings</h3> </a> <br> <a href="http://www.vigorworkouts.com/results-page/"> <i class="fa fa-user fa-3x"></i><h3 style="display: inline;">My Results Page</h3> </a> <br> <a> <i class="fa fa-envelope-o fa-3x"></i><h3 style="display: inline;">Contact your trainer</h3> </a> <br> <p style="font-size:16pt;margin-bottom: 0px;letter-spacing: -1px;line-height: 23px;">If you have any questions or comments about your workout, enter them in the box below and click Send to send the message directly to your trainer. Your trainer will reply via email</p> <br> <form action="/../wp-content/themes/x-child-renew/Custom Forms/contactTrainer.php" method="post"> <textarea name="cf_message" style="width: 100%;height: 200px"></textarea> <br> <input type="submit" value="Send"> <input type="reset" value="Clear"> </form> <?php x_link_pages(); ?> </div> </div> <?php x_google_authorship_meta(); ?> </article> </div> </div> </div> <!-- end .site --> <?php wp_footer(); ?> </body> </html> <?php } else if ( $user_role == "trainer" ) { //if user is a trainer global $display_name , $user_email; get_currentuserinfo(); $page_title = $user_email; $post_type = "post"; $output = "OBJECT"; $post = get_page_by_title( $page_title, $output, $post_type ); ?> <div class="x-container-fluid max width offset cf"> <div class="x-main full" role="main"> <h1 class="h-custom-headline mbm center-text h4 accent"><span>Members</span></h1> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-wrap" > <div class="entry-content content"> <a href='http://www.vigorworkouts.com/clients'> <i class="fa fa-child fa-3x"></i><h3 style="display: inline;">MY CLIENTS</h3> </a> <br> <a href="http://www.vigorworkouts.com/account-settings-page/"> <i class="fa fa-cog fa-3x"></i><h3 style="display: inline;">My Account Settings</h3> </a> <?php x_link_pages(); ?> </div> </div> <?php x_google_authorship_meta(); ?> </article> </div> </div> </div> <!-- end .site --> <?php wp_footer(); ?> </body> </html> <?php } else { //if user has not purchased a workout and is not trainer ?> <div class="x-container-fluid max width offset cf"> <div class="x-main full" role="main"> <?php while ( have_posts() ) : the_post(); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-wrap" style="padding: 0 87px;"> <div class="entry-content content"> <?php the_content(); ?> <?php x_link_pages(); ?> </div> </div> <?php x_google_authorship_meta(); ?> </article> <?php endwhile; ?> </div> </div> <?php get_footer(); ?> </div> <!-- end .site --> <?php wp_footer(); ?> </body> </html> <?php } } else { // if user is not logged in require ( $_SERVER['DOCUMENT_ROOT'] . '/wp-login.php'); } ?>
There appears to be three references to x_google_authorship_meta in the code above, and they all look like this: <?php x_google_authorship_meta(); ?>. If I simply delete each of those three lines, will the code above still work?
September 20, 2014 at 3:25 am #108518Hi there,
Please delete those lines and it should work.
Hope it helps.
-
AuthorPosts