Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* WordPress 3.0 Menu Editor ********************************************/
- // add menu support and fallback menu if menu doesn't exist
- function wpj_register_menu() {
- if (function_exists('register_nav_menu')) {
- register_nav_menu( 'wpj-main-menu', __( 'Main Menu', 'brightpage' ) );
- }
- }
- /*register_nav_menu (wpj-main-menu/footer-menu) ta menu register korar jonno theme locetion
- theke and 2nd ta (Main Menu/Footer Menu) menur nam anar jonno*/
- register_nav_menu( 'footer-menu', __( 'Footer Menu', 'brightpage' ) );
- add_action('init', 'wpj_register_menu');
- /* menu fallback code */
- function wpj_default_menu() {
- echo '<ul id="dropmenu">';
- if ('page' != get_option('show_on_front')) {
- echo '<li><a href="'. home_url() . '/">Home</a></li>';
- }
- wp_list_pages('title_li=');
- echo '</ul>';
- }
- /*end menu function */
- /* menu Header e call korte*/
- <?php
- if (function_exists('wp_nav_menu')) {
- wp_nav_menu(array('theme_location' => 'wpj-main-menu', 'menu_id' => 'nav', 'fallback_cb' => 'wpj_default_menu'));
- }
- else {
- wpj_default_menu();
- }
- ?>
- /* menu id r jaygay class thakle menu_class hobe */
- /* jodi id or class na thake tahole sudhu theme location hobe
- mane je name menu register kora hobe
- */
- <?php wp_nav_menu( array( 'theme_location' => 'wpj-main-menu') ); ?>
- /* footer menu clall korar jonno */
- <?php wp_nav_menu( array( 'theme_location' => 'footer-menu', 'menu_id' => 'footer_menu') ); ?>
- /* Register sidebars and widgetized areas ********************************************/
- function sanchari_widgets() {
- register_sidebar( array(
- 'name' => __( 'Promo1', 'wp_sourse' ),/*This name is unique
- to the widget and appears on
- the Widgets page on the Dashboard;
- this name is helpful if you register
- several widgetized areas on your site. */
- 'id' => 'promo1',/*This is the unique ID given to the widget. */
- 'description' => __( βThe primary widget areaβ),/* This is a text description
- of the widget. The text appears on
- the Widgets page on the Dashboard.
- This is optional.
- */
- 'before_widget' => '<div class="single_promo promo1">',/* */
- 'after_widget' => '</div>',/* */
- 'before_title' => '<h2>',/* */
- 'after_title' => '</h2>',/* */
- ) );
- }
- add_action( 'widgets_init', 'sanchari_widgets' );
- /* widgetized call two types
- 1. *****Normal****
- <?php dynamic_sidebar('sidebar_id'); ?>
- 2.*******for fallback data********
- <?php if ( ! dynamic_sidebar('sidebar_id') ) : ?>
- YOUR DEFAULT DATA
- <?php endif; ?>
- */
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement