mbwd-william

Author profile page

Jul 29th, 2021 (edited)
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.17 KB | None | 0 0
  1. <div class="author-profile-page" style="margin-top: 10px;">
  2.             <a name="top-of-list"></a>
  3.             <h3>List of Publications</h3>
  4.             <ol>
  5.             <?php // Loops through list of publications and creates a numbered list of anchor links out of the titles.
  6.  
  7.                 if( have_rows('book') ):
  8.  
  9.                     // loop through the rows of data
  10.                     while ( have_rows('book') ) : the_row(); ?>
  11.  
  12.                     <?php // display the title linked to the anchor text ?>
  13.                
  14.                         <li><a href="#<?php the_sub_field('book_title'); ?>"><?php the_sub_field('book_title'); ?></a>&nbsp;(<?php the_sub_field('year_of_publication'); ?>)</li>
  15.                
  16.              
  17.  
  18.                 <?php
  19.  
  20.                     endwhile;
  21.  
  22.                     else :
  23.  
  24.                     // no rows found
  25.  
  26.                 endif;
  27.  
  28. ?>
  29.                 </ol>
  30.  
  31.             <?php
  32.  
  33.                 // check if the Publication repeater field has rows of data
  34.                 if( have_rows('book') ):
  35.  
  36.                 // loop through the rows of data
  37.                 while ( have_rows('book') ) : the_row(); ?>
  38.  
  39.                    
  40.                     <a name="<?php the_sub_field('book_title'); ?>"></a>
  41.                     <h3><?php the_sub_field('book_title'); ?>&nbsp;(<?php the_sub_field('type'); ?>)</h3>
  42.  
  43.                             <?php if (get_sub_field('magazine_name') ): ?>
  44.                                 <p style="margin-bottom: .5em;">Publication: <?php the_sub_field('magazine_name'); ?>
  45.                             <?php endif; ?>
  46.                                
  47.                             <?php if (get_sub_field('issue_date') ): ?>
  48.                             <p style="margin-bottom: .5em;">Issue Date: <?php the_sub_field('issue_date'); ?>
  49.                             <?php endif; ?>
  50.  
  51.  
  52.                             <?php if (get_sub_field('issue') ): ?> 
  53.                             <p style="margin-bottom: .5em;">Issue No: <?php the_sub_field('issue'); ?>
  54.                             <?php endif; ?>
  55.  
  56.  
  57.                             <?php if (get_sub_field('volume') ): ?>
  58.                             <p style="margin-bottom: .5em;">Volume No: <?php the_sub_field('volume'); ?>
  59.                            
  60.                             <?php endif; ?>
  61.  
  62.                     <img width="25%" src="<?php the_sub_field('cover_image'); ?> ">
  63.                     <p>Year of publication: <?php the_sub_field('year_of_publication'); ?>
  64.                     <?php if (get_sub_field('publisher') ): ?>
  65.                     <p>Publisher: <?php the_sub_field('publisher'); ?>
  66.                     <?php endif; ?>
  67.                        
  68.                         <?php if (get_sub_field('subgenre') ): ?>
  69.                             <p>Genre: <?php the_sub_field('subgenre'); ?>
  70.                         <?php endif; ?>
  71.                     <p>Description: <?php the_sub_field('book_description'); ?>
  72.  
  73.  
  74.  
  75.                                 <?php // check for book links (sub repeater)
  76.                             if( have_rows('book_link') ): ?>
  77.                                 <h3>Publication Links</h3>
  78.                                     <?php
  79.                                         // loop through rows (sub repeater)
  80.                                             while( have_rows('book_link') ): the_row();
  81.  
  82.                                         // display each item as a list - with a class of completed ( if completed ) ?>
  83.                                    
  84.                                        
  85.                                         <a href="<?php the_sub_field('book_link'); ?>">
  86.                                             <?php the_sub_field('link_name'); ?></a><br />
  87.                                         <?php endwhile; ?>
  88.                                
  89.                             <?php endif; //if( get_sub_field('book_link') ): ?>
  90.  
  91.                             <center><a href="#top-of-list">Back to top of list</a></center>
  92.  
  93.                             <hr />
  94.                        
  95.              
  96.                 <?php
  97.  
  98.              endwhile;
  99.  
  100.                 else :
  101.  
  102.                     // no rows found
  103.  
  104.                 endif;
  105.  
  106. ?>
  107.  
  108.         </div>
Add Comment
Please, Sign In to add comment