Ver código fonte

faculty profile 14

Rousnay 1 ano atrás
pai
commit
45bfc2976f
1 arquivos alterados com 22 adições e 20 exclusões
  1. 22 20
      single-faculty.php

+ 22 - 20
single-faculty.php

@@ -10,31 +10,33 @@ 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/faculty_member' != $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
-		}
-
-		var_dump($my_block_id);
-	}
+	// 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);
+
+				// if
+			}
+		}
+	}
+
 
 ?>