General tags
Bloginfo()
If you need the values for use in PHP , use get_bloginfo().
Displays information about your site, mostly gathered from the information you supply in your User Profile and General Settings WordPress Administration Screens.
<?php bloginfo( $show ); ?>
name’ – Displays the “Site Title” set in Settings > General. This data is retrieved from the “blogname” record in the wp_options table.
‘description’ – Displays the “Tagline” set in Settings > General. This data is retrieved from the “blogdescription” record in the wp_options table.
‘language’ – Displays the language of WordPress.
‘stylesheet_url’ – Displays the primary CSS (usually style.css) file URL of the active theme. Consider echoing get_stylesheet_uri() instead.
Get_header()
Includes the header.php template file from your current theme’s directory.if a name is specified then a specialised header header-{name}.phpwill be included
<?php get_header( $name ); ?>
<?php if ( is_home() ) : get_header( 'home' );
elseif ( is_404() ) : get_header( '404' );
else : get_header(); endif; ?>
The file names for the home and 404 headers should be header-home.php and header-404.php respectively.
Get_footer()
Includes the footer.php template file from your current theme’s directory.if a name is specified then a specialised footer footer-{name}.php will be included.
<?php get_footer( $name ); ?>
<?php if ( is_home() ) : get_footer( 'home' );
elseif ( is_404() ) : get_footer( '404' );
else : get_footer(); endif; ?>
The file names for the home and 404 footers should be footer-home.php and footer-404.php respectively.
Get_sidebar()
Includes the sidebar.php template file from your current theme’s directory.If a name ($name) is specified then a specialized sidebar sidebar-{name}.php will be included. If sidebar-{name}.php does not exist, then it will fallback to loadingsidebar.php.
<?php get_sidebar( $name ); ?>
Left and Right Sidebars
<?php get_header(); ?>
<?php get_sidebar( 'left' ); ?>
<?php get_sidebar( 'right' ); ?>
<?php get_footer(); ?>
The file names for the right and left sidebars should be sidebar-right.php and sidebar-left.php respectively.
Multi sidebars
Different sidebar for different pages
<?php if ( is_home() ) : get_sidebar( 'home' );
elseif ( is_404() ) : get_sidebar( '404' );
else : get_sidebar(); endif; ?>
The file names for the home and 404 sidebars should be sidebar-home.php and sidebar-404.php respectively.
Wp_get_archives()
This function displays a date-based archives list or list of post.This tag can be used anywhere within a template.
<?php wp_get_archives( $args ); ?>
Parameters
type (string) The type of archive list to display. Defaults to WordPress settings.
Valid values:
yearly monthly – Default
daily
weekly
postbypost (posts ordered by post date)
alpha (same as postbypost but posts are ordered by post title)
limit (integer) Number of archives to get. Default is no limit.
format (string) Format for the archive list. Valid values:
html – In HTML list (<li>)
Parameters
before (string) Text to place before the link when using the html or custom for format option. There is no default.
after (string) Text to place after the link when using the html or custom for format option. There is no default.
show_post_count (boolean) Display number of posts in an archive or do not. For use with all type except ‘postbypost’.
1 (True)
0 (False) – Default
Displays archive list by month, displaying only the last twelve months that have posts
<?php wp_get_archives( array( 'type' => 'monthly', 'limit' => 12 ) ); ?>
Displays archive list by date, displaying only the last fifteen days
<?php wp_get_archives( array( 'type' => 'daily', 'limit' => 15 ) ); ?>
Displays archive list of the last twenty most recent posts listed by post title.
<?php wp_get_archives( array( 'type' => 'postbypost', 'limit' => 20, 'format' => 'custom' ) ); ?>