Browse Source

faculty profile 12

Rousnay 1 year ago
parent
commit
c08683f952
1 changed files with 20 additions and 22 deletions
  1. 20 22
      single-faculty.php

+ 20 - 22
single-faculty.php

@@ -10,33 +10,31 @@ get_header(); ?>
 
 <?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
-	// 	}
-
-	// 	echo $my_block_id;
-	// }
-
+	$post_blocks = parse_blocks(get_the_content('', false, 166));
 
+	foreach ($post_blocks as $block) {
+		if ('acf/faculty_member' != $block['faculty_member']) {
+			continue;   // Skip this block if it's not the right block type
+		}
 
-	if (function_exists('get_field')) {
-		$pid = get_post();
-		if (has_blocks($pid_content)) {
-			$blocks = parse_blocks($pid->post_content);
-			foreach ($blocks as $block) {
-				var_dump($block);
-			}
+		if (isset($block['attrs']['id'])) {
+			$my_block_id = $block['attrs']['id'];
+			break;  // Found a hit, get out of the loop
 		}
+
+		var_dump($my_block_id);
 	}
 
+	// if ( function_exists( 'get_field' ) ) {
+	// 	$pid = get_post();
+	// 	if ( has_blocks( $pid_content ) ) {
+	// 		$blocks = parse_blocks( $pid->post_content );
+	// 		foreach ( $blocks as $block ) {
+	// 			var_dump( $block );
+	// 		}
+	// 	}
+	// }
+
 
 ?>