single-faculty.php 12 KB

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