Selaa lähdekoodia

News archive bug fixing

Md Mozahidur Rahman 1 vuosi sitten
vanhempi
commit
4ffedb028e
3 muutettua tiedostoa jossa 12 lisäystä ja 144 poistoa
  1. 5 66
      archive-event.php
  2. 1 1
      archive-faculty.php
  3. 6 77
      archive-news.php

+ 5 - 66
archive-event.php

@@ -14,92 +14,31 @@ get_header();
 <main id="primary" class="site-main">
 	<div class="sections">
 
-		<section id="all-news" class="container">
+		<section id="all-events" class="container">
 
-			<h2>All Events</h2>
+			<h2>All News</h2>
 
 			<hr>
 
 			<?php if (have_posts()) : ?>
 				<?php while (have_posts()) : the_post(); ?>
+					<div class="parent-grid">
 
-					<div class="grid">
-						<div class="stub">
-
-							<div class="stub-img-holder">
-								<img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_05.jpg" alt="">
-							</div>
-							<span class="news-date">January 1, 2023</span>
-
-							<a href="#">
-								<h3>Learning to make a museum more accessible</h3>
-							</a>
-
-						</div>
-
-						<div class="stub">
-							<div class="stub-img-holder">
-								<img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_02.jpg" alt="">
-							</div>
-							<span class="news-date">January 1, 2023</span>
-
-							<a href="#">
-								<h3>New blood test to identify infections could reduce global antibiotic overuse</h3>
-							</a>
-
-						</div>
-
-						<div class="stub">
-							<div class="stub-img-holder">
-								<img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/gettybacktoschool.webp" alt="">
-							</div>
-							<span class="news-date">January 5, 2023</span>
 
 
-							<a href="#">
-								<h3>New center at addresses the forces shaping early childhood</h3>
-							</a>
-
-						</div>
-					</div>
-					<div class="grid">
-						<div class="stub">
-
+						<div class="stub grid-sub-item">
 							<div class="stub-img-holder">
 								<img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_05.jpg" alt="">
 							</div>
-							<span class="news-date">January 1, 2023</span>
+							<span class="events-date">January 1, 2023</span>
 
 							<a href="#">
 								<h3>Learning to make a museum more accessible</h3>
 							</a>
-
 						</div>
 
-						<div class="stub">
-							<div class="stub-img-holder">
-								<img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_02.jpg" alt="">
-							</div>
-							<span class="news-date">January 1, 2023</span>
 
-							<a href="#">
-								<h3>New blood test to identify infections could reduce global antibiotic overuse</h3>
-							</a>
 
-						</div>
-
-						<div class="stub">
-							<div class="stub-img-holder">
-								<img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/gettybacktoschool.webp" alt="">
-							</div>
-							<span class="news-date">January 5, 2023</span>
-
-
-							<a href="#">
-								<h3>New center at addresses the forces shaping early childhood</h3>
-							</a>
-
-						</div>
 					</div>
 				<?php endwhile; ?>
 

+ 1 - 1
archive-faculty.php

@@ -93,7 +93,7 @@ get_header();
 		width: 100%;
 		padding: 5px;
 		box-shadow: 2px 2px 10px 6px rgba(0, 0, 0, 0.137254902);
-		margin: 30px auto !important;
+		margin: 30px auto;
 	}
 
 	#all-faculties .stub-img-holder {

+ 6 - 77
archive-news.php

@@ -17,99 +17,28 @@ get_header();
 		<section id="all-news" class="container">
 
 			<h2>All News</h2>
-
 			<hr>
-
 			<?php if (have_posts()) : ?>
 				<?php while (have_posts()) : the_post(); ?>
+					<div class="parent-grid">
 
-					<div class="grid">
-						<div class="stub">
-
-							<div class="stub-img-holder">
-								<img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_05.jpg" alt="">
-							</div>
-							<span class="news-date">January 1, 2023</span>
-
-							<a href="#">
-								<h3>Learning to make a museum more accessible</h3>
-							</a>
-
-						</div>
-
-						<div class="stub">
+						<div class="stub grid-sub-item">
 							<div class="stub-img-holder">
-								<img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_02.jpg" alt="">
+								<img class="stub-img" src="<?php echo get_the_post_thumbnail_url() ?>" alt="">
 							</div>
-							<span class="news-date">January 1, 2023</span>
+							<span class="news-date"><?php the_field('news_date'); ?></span>
 
-							<a href="#">
-								<h3>New blood test to identify infections could reduce global antibiotic overuse</h3>
+							<a href="<?php echo get_permalink(); ?>">
+								<h3><?php echo get_the_title(); ?></h3>
 							</a>
-
 						</div>
 
-						<div class="stub">
-							<div class="stub-img-holder">
-								<img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/gettybacktoschool.webp" alt="">
-							</div>
-							<span class="news-date">January 5, 2023</span>
-
-
-							<a href="#">
-								<h3>New center at addresses the forces shaping early childhood</h3>
-							</a>
-
-						</div>
-					</div>
-					<div class="grid">
-						<div class="stub">
-
-							<div class="stub-img-holder">
-								<img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_05.jpg" alt="">
-							</div>
-							<span class="news-date">January 1, 2023</span>
-
-							<a href="#">
-								<h3>Learning to make a museum more accessible</h3>
-							</a>
-
-						</div>
-
-						<div class="stub">
-							<div class="stub-img-holder">
-								<img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_02.jpg" alt="">
-							</div>
-							<span class="news-date">January 1, 2023</span>
-
-							<a href="#">
-								<h3>New blood test to identify infections could reduce global antibiotic overuse</h3>
-							</a>
-
-						</div>
-
-						<div class="stub">
-							<div class="stub-img-holder">
-								<img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/gettybacktoschool.webp" alt="">
-							</div>
-							<span class="news-date">January 5, 2023</span>
-
-
-							<a href="#">
-								<h3>New center at addresses the forces shaping early childhood</h3>
-							</a>
-
-						</div>
 					</div>
 				<?php endwhile; ?>
-
 				<?php the_posts_navigation(); ?>
-
 			<?php
 			else :
-
 				get_template_part('template-parts/content', 'none');
-
 			endif;
 			?>
 		</section>