White Screen

Hi,

I was updating my child theme functions.php to try to get social icons and author and date showing on my blog posts and I got this error:

Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.****

I have now got a white screen on the website, how do I fix this?

Thanks in advance.

Graeme

Don’t worry, fixed it

Glad to hear you got it sorted.

Cheers!

No probs, I think I caused it because I was trying to get the social icons displaying on blog posts only and not over the entire site. I am using this code, can you let me know how I display it on blog posts only?

add_action('x_before_the_content_end', function() 

		   {
  echo do_shortcode('[share title="Share this Post" facebook="true" twitter="true" email="true" pinterest="true" google="true" tumblr="true"]');
});

also what code do I use to enter author name and date below the title?

Hi @McIntosh,

I recommend changing your code to this, it’s more safer with added condition for posts.

add_action('x_before_the_content_end', 'social_share_code');

function social_share_code ()   {

if ( !is_singular('post') ) return false;
  
echo do_shortcode('[share title="Share this Post" facebook="true" twitter="true" email="true" pinterest="true" google="true" tumblr="true"]');

}

Sometimes, if the PHP version is wrong, adding function() { } directly as a callback will trigger internal server error (white screen).

As for your second question, are you referring to the post meta? If yes, you can enable it in Theme Options > Blog > CONTENT and toggle on the Post Meta option.

Thanks!

Thanks a lot for your help, didn’t realise you could just toggle the meta on or off. Thanks again

Glad we were able to help :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.