Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sbryan

macrumors member
Original poster
Jun 6, 2007
96
0
Well, I did have a sidebar.php file for my Wordpress theme, but it turns out that sidebar needs to be somewhat dynamic.

I had just done this to call the PHP file from my homepage:
PHP:
<?php include_once "sidebar.php"; ?>

I made the sidebar.php file into a custom Wordpress Page template, and I have function calls to fill in the information I need:

PHP:
<?php the_content(); ?>

PHP:
<?php the_meta(); ?>

Is there a way to call the PHP file now?

PHP:
<?php include_once "http://website.com/sidebar.php"; ?>

and

PHP:
<?php include_once "http://website.com/sidebar"; ?>

Do not work. They error out.

Do I even need PHP reference, can I just reference that extension-less link that Wordpress creates(the latter)?
 
If rowsdower's tip doesn't work, I have another suggestion. In my experience, if sidebar.php is at the root of your theme folder you should just need this:

Code:
<?php get_sidebar(); ?>

If that doesn't work, try this:

Code:
<?php include(TEMPLATEPATH."/sidebar.php");?>

The latter is what I use if I have multiple sidebar templates that I need use. Replace sidebar.php with the name of your template file of course...


PS. you know if you hit a rowsdower you get to keep it...:D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.