/**
- Register our sidebars and widgetized areas.
- it Contain 2 Side bar named "Left Sidebar" and "Right Sidebar" */
// Add Value Line in functions.php File
function wpb_widgets_init() {
register_sidebar( array(
'name' => __( 'left sidebar', 'wpb' ),
'id' => 'left-sidebar',
'description' => __( 'The main sidebar appears on the right on each page except the front page template', 'wpb' ),
'before_widget' => '<div class="side-index content-bg">',
'after_widget' => '</div>',
'before_title' => '<h3 class="list-header">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' =>__( 'right sidebar', 'wpb'),
'id' => 'right-sidebar',
'description' => __( 'Appears on the static front page template', 'wpb' ),
'before_widget' => '<div class="side-index content-bg">',
'after_widget' => '</div>',
'before_title' => '<h3 class="list-header">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'wpb_widgets_init' );
// Add Value Line in for calling the widget
<div>
<?php dynamic_sidebar( 'left-sidebar' ); ?>
</div>
<?php endif; ?>
// For Registering Custom Post type named Editor note // you can call it using any name by changing name, i called it editor note
// add value line in functions.php
/Editor note/
function create_posttype() {
register_post_type( 'Editor Note',
array(
'labels' => array(
'name' => __( 'Editor Note' ),
'singular_name' => __( 'Editor Note' )
),
'public' => true,
'supports' => array( 'title', 'editor' ),
'rewrite' => array('slug' => 'Editor Note'),
)
);
}
add_action( 'init', 'create_posttype' );
// add value line For call it, i skipped Post title
// you can add it using
$args = array('post_type' => 'Editor Note', 'posts_per_page' => 1 );
query_posts( $args );
// The Loop
while ( have_posts() ) : the_post();
?>
<?php the_content(); ?>
<?php endwhile; // Reset Query wp_reset_query(); ?>
//from stack overflow
$s
);
// The Query
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
_e("");
while ( $the_query->have_posts() ) {
$the_query->the_post();
?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php
}
}else{
?>
Sorry, but nothing matched your search criteria. Please try again with some different keywords.