瀏覽代碼

faculty profile 11

Rousnay 1 年之前
父節點
當前提交
48c10b50f8
共有 1 個文件被更改,包括 24 次插入10 次删除
  1. 24 10
      single-faculty.php

+ 24 - 10
single-faculty.php

@@ -10,20 +10,34 @@ get_header(); ?>
 
 <?php while (have_posts()) : the_post();
 
-	$post_blocks = parse_blocks(get_the_content('', false, 166));
+	// $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
-		}
+	// 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;
+	// }
 
-		if (isset($block['attrs']['id'])) {
-			$my_block_id = $block['attrs']['id'];
-			break;  // Found a hit, get out of the loop
-		}
 
-		echo $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);
+			}
+		}
 	}
+
+
 ?>
 
 	<section class="static-banner">