[FRAMEWORK] Xây dựng page notifications Phần 2 (ok)
1. Tạo icon notifications trên header :)

<?php if(!is_user_logged_in()) wp_redirect( SITE_URL."login" );?>
<!DOCTYPE html>
<html <?php language_attributes(); ?> >
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="profile" href="http://gmpg.org/xfn/11"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="https://unpkg.com/swiper@7/swiper-bundle.min.css"/>
<script src="<?php echo THEME_URL ?>assets/libs/js/jquery.min.js?ver=3.5.1"></script>
<script
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB8-ypkZ-83OMzbMUGrJWa2v-XBIqQWHdo&libraries=places">
</script>
<?php wp_head(); ?>
</head>
<body <?php body_class() ?> >
<div id="page-load" style="opacity: 0; visibility: hidden;"><span class="loader"> </span></div>
<div id="wrapper">
<header>
<?php if ( is_front_page() ){
//get_template_part( 'template-parts/header/header', 'home' );
} elseif ( is_page( 'community') ){
get_template_part( 'template-parts/header/header', 'tab' );
} elseif ( is_page('account') ){
if((isset($_GET["action"]) && $_GET['action'] != "view-event") or !isset($_GET["action"])){
get_template_part( 'template-parts/header/header', 'account' );
}
}elseif(is_page(["directory","market","news","events"])){
if(!isset($_GET["appt"])){
get_template_part( 'template-parts/header/header', 'tab' );
}
}elseif(is_singular("post")){
return;
} else {
get_template_part( 'template-parts/header/header', 'back' );
}
?>
</header>
<main id="main">C:\xampp\htdocs\wordpress8\wp-content\themes\addframwork\template-parts\header\header-tab.php
2. Sau khi ấn icon notifications chuyển đến trang notifications
Chú ý: Update thông báo về 0 khi đó trở về trang community sẽ không còn nhìn thấy thôn báo nữa.

C:\xampp\htdocs\wordpress8\wp-content\themes\addframwork\page-notifications.php
C:\xampp\htdocs\wordpress8\wp-content\themes\addframwork\framework\models\notification.php
Previous[FRAMEWORK] Xây dựng page notifications Phần 1 (ok)NextHướng dẫn tạo một bảng upload ảnh, image (ok)
Last updated
Was this helpful?