single-faculty.php 11 KB

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