single-faculty.php 12 KB

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