Browse Source

faculty profile 9

Rousnay 1 year ago
parent
commit
658dee90a9
1 changed files with 16 additions and 2 deletions
  1. 16 2
      single-faculty.php

+ 16 - 2
single-faculty.php

@@ -8,7 +8,21 @@
 get_header(); ?>
 
 
-<?php while (have_posts()) : the_post(); ?>
+<?php while (have_posts()) : the_post();
+
+	$post_blocks = parse_blocks(get_the_content('', false, 166));
+
+	foreach ($post_blocks as $block) {
+		if ('acf/intro-content' != $block['faculty_member']) {
+			continue;   // Skip this block if it's not the right block type
+		}
+
+		if (isset($block['attrs']['id'])) {
+			$my_block_id = $block['attrs']['id'];
+			break;  // Found a hit, get out of the loop
+		}
+	}
+?>
 
 	<section class="static-banner">
 		<div class="static-banner-underlay">
@@ -38,7 +52,7 @@ get_header(); ?>
 							<h2 class="profile-des">
 								<?php the_field('designation'); ?>
 							</h2>
-							<p><?php the_field('employeeid');
+							<p><?php echo $my_block_id;
 								?></p>
 
 							<?php if (have_rows('contact_details')) : ?>