Browse Source

UI work for home page

Md Mozahidur Rahman 1 year ago
parent
commit
9deca0c9ea
2 changed files with 50 additions and 73 deletions
  1. 15 6
      css/theme-styles.css
  2. 35 67
      page-template/page-home.php

+ 15 - 6
css/theme-styles.css

@@ -1724,21 +1724,30 @@ body.archive aside#secondary{
 }
 
 /* home page */
-.faculty-details:hover {
-    background-color: rgba(241, 136, 0, 0.15);
-    border-bottom-left-radius: 10px;
-    border-bottom-right-radius: 10px;
-}
 #faculty-carousel .car-img-holder {
     margin-bottom: 0!important;
 }
 #faculty-carousel .faculty-details {
     padding-top: 20px!important;
 }
-
+#faculty-carousel .faculty-details:hover {
+    background-color: rgba(241, 136, 0, 0.15);
+    border-bottom-left-radius: 10px;
+    border-bottom-right-radius: 10px;
+}
 #faculty-carousel .faculty-details h3 {
     white-space: pre-wrap!important;
 }
 #faculty-carousel a.faculty-name {
     text-decoration: none;
+}
+.event-holder .event-date {
+    position: relative;
+    margin-left: 0px!important;
+    margin-top: -25px;
+    height: 50px;
+    width: fit-content;
+    padding: 0 20px;
+    /* border-top-right-radius: 5px;
+    border-bottom-right-radius: 5px; */
 }

+ 35 - 67
page-template/page-home.php

@@ -302,7 +302,6 @@ get_header(); ?>
                                 </a>
                             </div>
                         </div>
-
                 <?php
                     endwhile;
                 else :
@@ -403,7 +402,7 @@ get_header(); ?>
                             </div>
                         </a>
 
-                        <a href="https://uiu.revinr.work/cse/notice/">
+                        <a href="/notice/">
 
                             <button>View All Notices</button>
                         </a>
@@ -521,7 +520,7 @@ get_header(); ?>
 
 
                 </div>
-                <a href="https://uiu.revinr.work/cse/news/">
+                <a href="/news/">
                     <button class="primary-c">View All News</button> </a>
             </div>
 
@@ -535,81 +534,49 @@ get_header(); ?>
                     <h1>Upcoming Events</h1>
 
                     <div class="grid">
-                        <div class="event-holder">
-                            <div class="event-img-holder">
-                                <img src="<?php echo (get_template_directory_uri()) ?>/img/0555.jpg" alt="">
-                            </div>
 
-                            <div class="event-date primary-c">
-                                <h3>Dec</h3>
-                                <h3>17</h3>
-                            </div>
 
-                            <div class="event-details">
-                                <a href="">
-                                    <h3>Seminar</h3>
-                                    <h2>Blockchain: The Coming Revolution</h2>
-                                </a>
-                            </div>
-                        </div>
 
-                        <div class="event-holder">
-                            <div class="event-img-holder">
-                                <img src="<?php echo (get_template_directory_uri()) ?>/img/2.jpg" alt="">
-                            </div>
+                        <?php
+                        $args = array(
+                            'post_type'      => 'event',
+                            'posts_per_page' => 5,
+                            //'post__not_in' => array(get_the_ID()),
+                            'orderby'        => 'date',
+                            'order'          => 'DESC',
+                        );
 
-                            <div class="event-date primary-c">
-                                <h3>Nov</h3>
-                                <h3>27</h3>
-                            </div>
+                        $query = new WP_Query($args);
 
-                            <div class="event-details">
-                                <a href="">
-                                    <h3>Pre-Advising</h3>
-                                    <h2>Blockchain: The Coming Revolution</h2>
-                                </a>
-                            </div>
-                        </div>
-
-                        <div class="event-holder">
-                            <div class="event-img-holder">
-                                <img src="<?php echo (get_template_directory_uri()) ?>/img/research_01.jpg" alt="">
-                            </div>
-
-                            <div class="event-date primary-c">
-                                <h3>Nov</h3>
-                                <h3>22</h3>
-                            </div>
+                        if ($query->have_posts()) :
+                            while ($query->have_posts()) :
+                                $query->the_post(); ?>
 
-                            <div class="event-details">
-                                <a href="">
-                                    <h3>Cultural Event</h3>
-                                    <h2>Blockchain: The Coming Revolution</h2>
-                                </a>
-
-                            </div>
-                        </div>
+                                <div class="event-holder">
+                                    <div class="event-img-holder">
+                                        <img src="<?php echo get_the_post_thumbnail_url(); ?>" alt="">
+                                    </div>
 
-                        <div class="event-holder">
-                            <div class="event-img-holder">
-                                <img src="<?php echo (get_template_directory_uri()) ?>/img/research_03.jpg" alt="">
-                            </div>
+                                    <div class="event-date primary-c">
+                                        <h3><?php the_field('event_date_start'); ?></h3>
+                                    </div>
 
-                            <div class="event-date primary-c">
-                                <h3>Nov</h3>
-                                <h3>12</h3>
-                            </div>
+                                    <div class="event-details">
+                                        <a href="">
+                                            <h3><?php echo get_the_title(); ?></h3>
+                                            <h2><?php the_field('event_venue'); ?></h2>
+                                        </a>
+                                    </div>
+                                </div>
 
-                            <div class="event-details">
-                                <a href="">
-                                    <h3>Seminar</h3>
-                                    <h2>Blockchain: The Coming Revolution</h2>
-                                </a>
+                        <?php
+                            endwhile;
+                        else :
+                            echo '<div class="no-post-found">No event has found! </div>';
+                        endif; ?>
 
-                            </div>
-                        </div>
                     </div>
-                    <a href="https://uiu.revinr.work/cse/event/">
+                    <a href="/event/">
                         <button class="primary-c">View all events</button>
                     </a>
                 </div>
@@ -655,4 +622,5 @@ get_header(); ?>
 <!-- </div> .row -->
 <!-- </div>.container -->
 
+
 <?php get_footer(); ?>