0

I am trying to dynamically get the facebook php sdk from my current themes folder.

I am writing this in my functions.php, but all my attempts break the site.

See my attempts below...

require template_url('/') . 'facebook-php-sdk-6c82b3f/src/facebook.php';

require get_bloginfo('template_url') . 'facebook-php-sdk-6c82b3f/src/facebook.php';

Can any one help me understand why this does not work?

Thank you very much.

2
  • have you echoed the result of your statements and seen what you're asking to be required? Might be a good starting point. Commented May 4, 2012 at 9:11
  • I just realized that it works with out the template url part. I thought I might have to require the full path, but it works relative to the where the functions php is. Silly me. Commented May 4, 2012 at 9:14

2 Answers 2

3

Use get_template_directory() instead , require doesn't work with http://

1
  • you're welcome, but like you said you don't need the full path. Commented May 4, 2012 at 9:39
0

I did not actually need to use the full path, it works using a relative path from the functions.php

require 'facebook-php-sdk-6c82b3f/src/facebook.php';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.