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