Sidebar files in a different folder

63 views
asked Oct 4, 2012 in Website Builder by DinoGuy (2,130 points)
Hi

I want to put the sidebar files in a separate folfer in order to keep them organized because I have many of them. My question is, if I did this how will I be able to retrieve files when calling the function get_sidebar();

thanks

2 Answers

0 like 0 dislike
answered Oct 4, 2012 by WebProX (12,200 points)
hi there
Try using get_template_part() instead:
http://codex.wordpress.org/Function_Reference/get_template_part
0 like 0 dislike
answered Oct 4, 2012 by expert (14,380 points)
if your side bar is 'sidebar-home.php' in the subfolder 'sidebar' then you can try:
get_template_part('sidebar/sidebar-home');
...