From 7f73460631d36b3399e1ba601c1ae19c9c0ee3be Mon Sep 17 00:00:00 2001 From: Hasin Hayder <countdraculla@gmail.com> Date: Tue, 22 May 2018 18:19:07 +0600 Subject: [PATCH] navigation menu and widget area --- footer.php | 12 ++++++++++++ functions.php | 36 +++++++++++++++++++++++++++++++++++- hero.php | 13 +++++++++++++ index.php | 6 ++++++ 4 files changed, 66 insertions(+), 1 deletion(-) diff --git a/footer.php b/footer.php index 9c293cf..0d3a4c0 100644 --- a/footer.php +++ b/footer.php @@ -15,6 +15,18 @@ } ?> + <div class="footermenu"> + <?php + wp_nav_menu( + array( + 'theme_location' => 'footermenu', + 'menu_id' => 'footermenucontainer', + 'menu_class' => 'list-inline text-right', + ) + ); + ?> + </div> + </div> </div> </div> diff --git a/functions.php b/functions.php index 715b196..d0b453f 100644 --- a/functions.php +++ b/functions.php @@ -4,6 +4,8 @@ function alpha_bootstrapping(){ load_theme_textdomain("alpha"); add_theme_support("post-thumbnails"); add_theme_support("title-tag"); + register_nav_menu("topmenu",__("Top Menu","alpha")); + register_nav_menu("footermenu",__("Footer Menu","alpha")); } add_action("after_setup_theme","alpha_bootstrapping"); @@ -51,4 +53,36 @@ function alpha_sidebar(){ ); } -add_action("widgets_init","alpha_sidebar"); \ No newline at end of file +add_action("widgets_init","alpha_sidebar"); + +function alpha_the_excerpt($excerpt){ + if(!post_password_required()){ + return $excerpt; + }else{ + echo get_the_password_form(); + } +} +add_filter("the_excerpt","alpha_the_excerpt"); + + +function alpha_protected_title_change(){ + return "%s"; +} +add_filter("protected_title_format","alpha_protected_title_change"); + + +function alpha_menu_item_class($classes , $item) { + $classes[] = "list-inline-item"; + return $classes; +} +add_filter("nav_menu_css_class","alpha_menu_item_class", 10, 2); + + + + + + + + + + diff --git a/hero.php b/hero.php index 2c5410e..ea1b679 100644 --- a/hero.php +++ b/hero.php @@ -9,6 +9,19 @@ <a href="<?php echo site_url(); ?>"><?php bloginfo( "name" ); ?></a> </h1> </div> + <div class="col-md-12"> + <div class="navigation"> + <?php + wp_nav_menu( + array( + 'theme_location' => 'topmenu', + 'menu_id' => 'topmenucontainer', + 'menu_class' => 'list-inline text-center', + ) + ); + ?> + </div> + </div> </div> </div> </div> \ No newline at end of file diff --git a/index.php b/index.php index babefdb..aa6c5a3 100644 --- a/index.php +++ b/index.php @@ -30,6 +30,12 @@ the_post_thumbnail( "large", array( "class" => "img-fluid" ) ); } + /*if(!post_password_required()){ + the_excerpt(); + }else{ + echo get_the_password_form(); + }*/ + the_excerpt(); ?> </p>