Rousnay пре 1 година
родитељ
комит
79f4bbaa50
1 измењених фајлова са 18 додато и 25 уклоњено
  1. 18 25
      single-faculty.php

+ 18 - 25
single-faculty.php

@@ -11,12 +11,10 @@ get_header(); ?>
 <?php while (have_posts()) : the_post();
 
 	$login_id_e = "";
-
 	if (function_exists('get_field')) {
 		$pid = get_post();
 		if (has_blocks($pid_content)) {
 			$blocks = parse_blocks($pid->post_content);
-			var_dump($blocks);
 			foreach ($blocks as $block) {
 				if ($block["blockName"] == "acf/faculty-member") {
 					$login_id_e = $block["attrs"]["data"]["login_id"];
@@ -24,6 +22,11 @@ get_header(); ?>
 			}
 		}
 	}
+
+
+
+
+
 ?>
 	<section class="static-banner">
 		<div class="static-banner-underlay">
@@ -54,8 +57,6 @@ get_header(); ?>
 								<?php the_field('designation'); ?>
 							</h2>
 
-							<p><?php echo $login_id_e ?></p>
-
 							<?php if (have_rows('contact_details')) : ?>
 
 								<?php while (have_rows('contact_details')) : the_row(); ?>
@@ -107,15 +108,12 @@ get_header(); ?>
 						<?php endif; ?>
 
 						<?php
-						$employeeid = get_field('employeeid');
-
-
 						$url = 'http://103.109.52.3/webapi/api/EmployeeJournal';
 						$response = wp_remote_post(
 							$url,
 							array(
 								'body' => array(
-									'employee_id' => $employeeid,
+									'employee_id' => $login_id_e,
 									"year"  => "",
 									'user_login_id' => 'api_user',
 									'auth_token' => 'api_user20230419045143'
@@ -123,26 +121,21 @@ get_header(); ?>
 
 							)
 						);
-						$data = json_decode(wp_remote_retrieve_body($response), true);
-
-						?>
 
-						<?php if (!empty($employeeid)) : ?>
-
-							<div class="bio desc-block">
-								<h2 class="m-text">Publication</h2>
-								<p class="m-text">
-									<?php
-									if (!empty($employeeid)) {
+						$data = json_decode(wp_remote_retrieve_body($response), true); ?>
 
-										print_r($data);
-									} else {
-										echo 'Please insert Login ID of the faculty member</ul></div>';
-									}
+						<div class="bio desc-block">
+							<h2 class="m-text">Publication</h2>
+							<p class="m-text">
+								<?php
+								if (!empty($login_id_e)) {
 
-									?>
-							</div>
-						<?php endif; ?>
+									print_r($data);
+								} else {
+									echo 'Please insert Login ID of the faculty member</ul></div>';
+								}
+								?>
+						</div>
 					</div>
 				</div>
 			</div>