|
@@ -29,7 +29,42 @@ get_header();
|
|
|
<div class="parent-grid">
|
|
|
|
|
|
<?php if (have_posts()) : ?>
|
|
|
- <?php while (have_posts()) : the_post(); ?>
|
|
|
+ <?php while (have_posts()) : the_post();
|
|
|
+
|
|
|
+ $login_id_e = "";
|
|
|
+ $auth_token = get_field('auth_token', 'option');
|
|
|
+ $client_id = get_field('client_id', 'option');
|
|
|
+ $employee_info_api = get_field('employee_info_api', 'option');
|
|
|
+
|
|
|
+ if (function_exists('get_field')) {
|
|
|
+ $pid_content = get_post();
|
|
|
+ if (has_blocks($pid_content)) {
|
|
|
+ $blocks = parse_blocks($pid_content->post_content);
|
|
|
+ foreach ($blocks as $block) {
|
|
|
+ if ($block["blockName"] == "acf/faculty-member") {
|
|
|
+ // $FullName = $block['login_id_e'];
|
|
|
+ $login_id_e = $block["attrs"]["data"]["login_id"];
|
|
|
+ // $Designation = $block["attrs"]["data"];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ $response_employeeInfo = wp_remote_post(
|
|
|
+ $employee_info_api,
|
|
|
+ array(
|
|
|
+ 'body' => array(
|
|
|
+ 'user_login_id' => $client_id,
|
|
|
+ 'login_id' => $login_id_e,
|
|
|
+ 'auth_token' => $auth_token
|
|
|
+ )
|
|
|
+ )
|
|
|
+ );
|
|
|
+ $employeeInfo = json_decode(wp_remote_retrieve_body($response_employeeInfo), true);
|
|
|
+ $Title = $employeeInfo[0]['Title'];
|
|
|
+ $FullName = $Title . ' ' . $employeeInfo[0]['FullName'];
|
|
|
+ $Designation = $employeeInfo[0]['Designation'] . ' ' . $employeeInfo[0]['Office'];
|
|
|
+ ?>
|
|
|
|
|
|
|
|
|
<div class="faculty-stub grid-sub-item">
|
|
@@ -40,12 +75,14 @@ get_header();
|
|
|
<a class="faculty-link" href="<?php echo get_the_permalink(); ?>">
|
|
|
<div class="archive-faculty-details">
|
|
|
|
|
|
- <h3><?php echo get_the_title(); ?></h3>
|
|
|
+ <h3>
|
|
|
+ <?php echo $FullName; ?><span class="degree"><?php if ($Title == "Dr.") {
|
|
|
+ echo ', PhD';
|
|
|
+ } ?></span>
|
|
|
+ </h3>
|
|
|
|
|
|
<span class="faculty-designation">
|
|
|
- Department of Computer Science and Engineering
|
|
|
- <?php //the_field('designation');
|
|
|
- ?>
|
|
|
+ <?php echo $Designation; ?>
|
|
|
</span>
|
|
|
|
|
|
</div>
|