single-faculty.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. <?php
  2. /**
  3. * The template for displaying all single faculty posts
  4. *
  5. * @package UIU_CSE
  6. */
  7. get_header(); ?>
  8. <?php while (have_posts()) : the_post();
  9. // $post_blocks = parse_blocks(get_the_content('', false, 166));
  10. // foreach ($post_blocks as $block) {
  11. // if ('acf/faculty_member' != $block['faculty_member']) {
  12. // continue; // Skip this block if it's not the right block type
  13. // }
  14. // if (isset($block['attrs']['id'])) {
  15. // $my_block_id = $block['attrs']['id'];
  16. // break; // Found a hit, get out of the loop
  17. // }
  18. // var_dump($my_block_id);
  19. // }
  20. if (function_exists('get_field')) {
  21. $pid = get_post();
  22. if (has_blocks($pid_content)) {
  23. $blocks = parse_blocks($pid->post_content);
  24. var_dump($blocks);
  25. foreach ($blocks as $block) {
  26. var_dump($block);
  27. if ($block["blockName"] == "acf/faculty-member") {
  28. echo "got it";
  29. echo $block["blockName"]["attrs"]["data"]["login_id"];
  30. }
  31. }
  32. }
  33. }
  34. ?>
  35. <section class="static-banner">
  36. <div class="static-banner-underlay">
  37. <img src="<?php echo get_the_post_thumbnail_url(); ?>" alt="">
  38. </div>
  39. <div class="static-banner-overlay"></div>
  40. </section>
  41. <main>
  42. <section class="profile-header">
  43. <div class="profile-main">
  44. <div class="container">
  45. <div class="top-row">
  46. <div class="profile-img-container">
  47. <img src="<?php the_field('profile_photo'); ?>" alt="">
  48. </div>
  49. <div class="profile-header-text">
  50. <!-- <h3 class="sub-title">Faculty Profile</h3> -->
  51. <h1 class="profile-name">
  52. <?php echo get_the_title(); ?>
  53. </h1>
  54. <h2 class="profile-des">
  55. <?php the_field('designation'); ?>
  56. </h2>
  57. <p><?php //echo $my_block_id;
  58. ?></p>
  59. <?php if (have_rows('contact_details')) : ?>
  60. <?php while (have_rows('contact_details')) : the_row(); ?>
  61. <span class="contact-dets"><?php the_sub_field('contact_info'); ?></span>
  62. <?php
  63. // $sub_field_3 = get_sub_field('sub_field_3');
  64. // do something with $sub_field_3
  65. ?>
  66. <?php endwhile; ?>
  67. <?php endif; ?>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </section>
  73. <section class="profile-body primary-c">
  74. <div class="container">
  75. <div class="profile-second-row">
  76. <div class="left-col">
  77. <ul class="profile-choices">
  78. </ul>
  79. </div>
  80. <div class="profile-main-description">
  81. <?php if (have_rows('main_information')) : ?>
  82. <?php while (have_rows('main_information')) : the_row(); ?>
  83. <span class="contact-dets"></span>
  84. <div class="bio desc-block">
  85. <h2 class="m-text"><?php the_sub_field('title'); ?></h2>
  86. <p class="m-text">
  87. <?php the_sub_field('contents'); ?>
  88. </p>
  89. </div>
  90. <?php endwhile; ?>
  91. <?php endif; ?>
  92. <?php
  93. $employeeid = get_field('employeeid');
  94. $url = 'http://103.109.52.3/webapi/api/EmployeeJournal';
  95. $response = wp_remote_post(
  96. $url,
  97. array(
  98. 'body' => array(
  99. 'employee_id' => $employeeid,
  100. "year" => "",
  101. 'user_login_id' => 'api_user',
  102. 'auth_token' => 'api_user20230419045143'
  103. )
  104. )
  105. );
  106. $data = json_decode(wp_remote_retrieve_body($response), true);
  107. ?>
  108. <?php if (!empty($employeeid)) : ?>
  109. <div class="bio desc-block">
  110. <h2 class="m-text">Publication</h2>
  111. <p class="m-text">
  112. <?php
  113. if (!empty($employeeid)) {
  114. print_r($data);
  115. } else {
  116. echo 'Please insert Login ID of the faculty member</ul></div>';
  117. }
  118. ?>
  119. </div>
  120. <?php endif; ?>
  121. </div>
  122. </div>
  123. </div>
  124. </section>
  125. </main>
  126. <!-- #main -->
  127. <?php endwhile; // end of the loop.
  128. ?>
  129. <style>
  130. header {
  131. margin: 0px !important;
  132. padding: 0px !important;
  133. height: 350px;
  134. overflow: hidden;
  135. }
  136. main {
  137. min-height: calc(100vh - 400px);
  138. position: relative;
  139. padding: 0px !important;
  140. background: rgb(56, 32, 23);
  141. background: linear-gradient(180deg, rgb(48, 18, 7) 0%, rgb(40, 21, 13) 22%, rgb(5, 0, 6) 100%);
  142. height: 100%;
  143. }
  144. h1 {
  145. font-family: "DM Serif Text", serif;
  146. font-size: 40px !important;
  147. letter-spacing: 2px !important;
  148. line-height: 110%;
  149. color: #fff;
  150. width: 100%;
  151. margin: 20px auto !important;
  152. text-align: left;
  153. }
  154. h2 {
  155. font-family: "DM Serif Text", serif;
  156. font-size: 40px;
  157. line-height: 45px;
  158. color: #ffc3c3;
  159. width: 100%;
  160. margin: 20px auto;
  161. text-align: left;
  162. }
  163. p {
  164. max-width: 1200px;
  165. font-size: 18px;
  166. color: #ffc3c3;
  167. margin: 50px 15px !important;
  168. }
  169. .desc-block ul>li {
  170. list-style: none;
  171. font-size: 16px;
  172. line-height: 20px;
  173. font-size: 18px;
  174. color: #ffc3c3;
  175. }
  176. .static-banner {
  177. position: relative;
  178. }
  179. .static-banner .static-banner-underlay {
  180. position: fixed;
  181. height: 100%;
  182. width: 100%;
  183. top: 0px;
  184. }
  185. .static-banner .static-banner-underlay img {
  186. height: 100%;
  187. width: 100%;
  188. -o-object-fit: cover;
  189. object-fit: cover;
  190. -o-object-position: bottom;
  191. object-position: bottom;
  192. }
  193. .static-banner .static-banner-overlay {
  194. position: fixed;
  195. width: 100%;
  196. height: 100%;
  197. background-color: #0b1419;
  198. opacity: 0.8;
  199. }
  200. .profile-header {
  201. position: absolute;
  202. top: -300px;
  203. width: 100%;
  204. }
  205. .top-row {
  206. display: flex;
  207. flex-direction: row;
  208. margin-top: 50px;
  209. }
  210. @media screen and (max-width: 600px) {
  211. .top-row {
  212. display: flex;
  213. flex-direction: column;
  214. justify-content: center;
  215. align-items: center;
  216. margin-top: -10px;
  217. }
  218. }
  219. .profile-img-container {
  220. flex-basis: 200px;
  221. border-radius: 50%;
  222. border: 2px solid #F68B1F;
  223. overflow: hidden;
  224. }
  225. .profile-img-container img {
  226. height: 100%;
  227. width: 100%;
  228. -o-object-position: top;
  229. object-position: top;
  230. -o-object-fit: cover;
  231. object-fit: cover;
  232. }
  233. @media screen and (max-width: 600px) {
  234. .profile-img-container {
  235. flex-basis: 100px;
  236. width: 100px !important;
  237. height: 100px !important;
  238. border-radius: 50%;
  239. border: 2px solid #F68B1F;
  240. overflow: hidden;
  241. }
  242. }
  243. .profile-header-text {
  244. margin: 20px 0px 0px 50px !important;
  245. }
  246. @media screen and (max-width: 600px) {
  247. .profile-header-text {
  248. margin: 20px 0px !important;
  249. }
  250. }
  251. .profile-header-text h1 {
  252. font-size: 40px !important;
  253. margin: 5px 0px !important;
  254. }
  255. .profile-header-text h2 {
  256. font-size: 20px !important;
  257. line-height: 24px !important;
  258. color: #fff;
  259. letter-spacing: 2px;
  260. font-weight: normal;
  261. margin: 5px 0px !important;
  262. }
  263. .profile-header-text .contact-dets {
  264. display: inline-block;
  265. font-size: 12px;
  266. margin-top: 15px !important;
  267. margin-right: 20px !important;
  268. font-weight: lighter;
  269. color: #fff;
  270. letter-spacing: 2px;
  271. }
  272. .profile-header-text h3 {
  273. font-size: 14px !important;
  274. text-transform: uppercase;
  275. text-decoration: none !important;
  276. font-family: "Open Sans", sans-serif;
  277. letter-spacing: 2px;
  278. text-align: center !important;
  279. font-weight: normal;
  280. margin: 5px 0px 0px 0px !important;
  281. text-align: left !important;
  282. }
  283. @media screen and (max-width: 700px) {
  284. .profile-header-text {
  285. text-align: center;
  286. }
  287. .profile-header-text h1 {
  288. font-size: 20px !important;
  289. margin: 5px 0px 0px 0px !important;
  290. text-align: center;
  291. }
  292. .profile-header-text h2 {
  293. font-size: 14px !important;
  294. line-height: 16px !important;
  295. color: #fff;
  296. letter-spacing: 2px;
  297. font-weight: normal;
  298. margin: 5px 0px 10px 0px !important;
  299. text-align: center;
  300. }
  301. .profile-header-text h3 {
  302. font-size: 14px !important;
  303. text-transform: uppercase;
  304. text-decoration: none !important;
  305. font-family: "Open Sans", sans-serif;
  306. letter-spacing: 2px;
  307. text-align: center !important;
  308. font-weight: normal;
  309. margin: 5px 0px 0px 0px !important;
  310. text-align: center;
  311. }
  312. .profile-header-text .contact-dets {
  313. display: block;
  314. font-size: 12px;
  315. margin-top: 5px !important;
  316. font-weight: lighter;
  317. color: #fff;
  318. letter-spacing: 1px;
  319. }
  320. }
  321. .profile-second-row {
  322. display: flex;
  323. flex-direction: row;
  324. justify-content: space-between;
  325. }
  326. .left-col {
  327. margin-right: 30px;
  328. width: 400px;
  329. }
  330. @media screen and (max-width: 650px) {
  331. .left-col {
  332. display: none;
  333. }
  334. }
  335. ul.profile-choices>li {
  336. list-style: none;
  337. border-radius: 5px;
  338. overflow: hidden;
  339. height: 50px;
  340. }
  341. ul.profile-choices>li a {
  342. padding: 5px 10px;
  343. font-size: 20px;
  344. line-height: 40px;
  345. font-weight: lighter;
  346. color: #fff;
  347. display: flex;
  348. flex-direction: row;
  349. justify-content: space-between;
  350. transition-duration: 0.5s;
  351. height: 50px !important;
  352. }
  353. ul.profile-choices>li a:after {
  354. content: "chevron_right";
  355. font-family: "Material Icons";
  356. font-size: 20px;
  357. margin-right: 10px;
  358. }
  359. ul.profile-choices>li a:hover {
  360. color: #000;
  361. text-decoration: none;
  362. background-color: rgba(255, 255, 255, 0.2039215686);
  363. }
  364. .pickr {
  365. display: inline-block;
  366. margin-right: 6px !important;
  367. }
  368. .profile-des {
  369. font-family: "Open Sans", sans-serif;
  370. font-size: 25px;
  371. font-weight: normal;
  372. margin: 5px 0px;
  373. color: #fff;
  374. }
  375. details {
  376. margin-left: 0px !important;
  377. }
  378. .accordions {
  379. margin-top: 100px;
  380. }
  381. .sub-title {
  382. font-family: "Open Sans", sans-serif !important;
  383. font-size: 14px;
  384. letter-spacing: 5px;
  385. }
  386. b {
  387. font-weight: 500 !important;
  388. font-size: 22px !important;
  389. }
  390. i {
  391. font-size: 14px;
  392. margin-bottom: 130px !important;
  393. border-bottom: 1px solid #fff;
  394. }
  395. ul {
  396. margin-top: 20px !important;
  397. margin-bottom: 50px !important;
  398. }
  399. ul>li {
  400. list-style: none;
  401. font-size: 16px;
  402. line-height: 20px;
  403. }
  404. h2.m-text {
  405. font-size: 30px;
  406. margin-left: 0px;
  407. font-weight: normal;
  408. }
  409. .desc-block {
  410. opacity: 1;
  411. transition-duration: 0.4s;
  412. overflow: none;
  413. }
  414. .desc-block-hidden {
  415. display: none;
  416. }
  417. .desc-active {
  418. text-decoration: none;
  419. background-color: rgba(255, 255, 255, 0.2039215686);
  420. }
  421. .desc-active a {
  422. color: #000;
  423. }
  424. ul.m-text {
  425. margin-top: 10px !important;
  426. }
  427. /* The Overlay (background) */
  428. .overlay {
  429. /* Height & width depends on how you want to reveal the overlay (see JS below) */
  430. height: 0%;
  431. width: 100%;
  432. position: fixed;
  433. /* Stay in place */
  434. z-index: 1100;
  435. /* Sit on top */
  436. left: 0;
  437. top: 0;
  438. background-color: rgb(0, 0, 0);
  439. /* Black fallback color */
  440. background-color: rgba(0, 0, 0, 0.9);
  441. /* Black w/opacity */
  442. overflow-x: hidden;
  443. /* Disable horizontal scroll */
  444. transition: 0.5s;
  445. /* 0.5 second transition effect to slide in or slide down the overlay (height or width, depending on reveal) */
  446. }
  447. /* Position the content inside the overlay */
  448. .overlay-content {
  449. position: relative;
  450. height: 100%;
  451. top: 25%;
  452. /* 25% from the top */
  453. width: 100%;
  454. /* 100% width */
  455. text-align: center;
  456. /* Centered text/links */
  457. margin-top: 30px;
  458. /* 30px top margin to avoid conflict with the close button on smaller screens */
  459. }
  460. /* The navigation links inside the overlay */
  461. .overlay a {
  462. padding: 8px;
  463. text-decoration: none;
  464. font-size: 18px;
  465. color: white;
  466. display: block;
  467. /* Display block instead of inline */
  468. transition: 0.3s;
  469. /* Transition effects on hover (color) */
  470. }
  471. .overlay h1 {
  472. color: white;
  473. font-size: 20px;
  474. font-weight: lighter;
  475. margin-bottom: 10px;
  476. text-decoration: underline;
  477. }
  478. /* When you mouse over the navigation links, change their color */
  479. .overlay a:hover,
  480. .overlay a:focus {
  481. color: #f1f1f1;
  482. }
  483. /* Position the close button (top right corner) */
  484. .overlay .closebtn {
  485. position: absolute;
  486. top: 20px;
  487. right: 45px;
  488. font-size: 60px;
  489. }
  490. </style>
  491. <?php get_footer(); ?>