single-faculty.php 12 KB

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