Skip to content

Instantly share code, notes, and snippets.

@atticoos
Created April 17, 2014 04:17
Show Gist options
  • Save atticoos/10952498 to your computer and use it in GitHub Desktop.
Save atticoos/10952498 to your computer and use it in GitHub Desktop.
<?php get_header(); ?>
<div id="main-content">
<h2><?php the_title(); ?></h2>
<p><?php the_content(); ?></p>
</div>
<div id="sidebar">
First sidebar:
<?php get_sidebar(); ?>
Second Sidebar:
<?php get_sidebar('two'); ?>
</div>
<?php get_footer(); ?>
<div>
This is another sidebar, it will be shown anytime you call get_sidebar('two');
Notice how the filename is "sidebar-two.php"?
Anytime you call get_sidebar() --> it will look for "sidebar.php"
If you pass an argument, such as get_sidebar("NAME) --> it will look for "sidebar-NAME.php"
</div>
<div>
This is your main side bar :) It will be shown any time you call get_sidebar();
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment