Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="author-profile-page" style="margin-top: 10px;">
- <a name="top-of-list"></a>
- <h3>List of Publications</h3>
- <ol>
- <?php // Loops through list of publications and creates a numbered list of anchor links out of the titles.
- if( have_rows('book') ):
- // loop through the rows of data
- while ( have_rows('book') ) : the_row(); ?>
- <?php // display the title linked to the anchor text ?>
- <li><a href="#<?php the_sub_field('book_title'); ?>"><?php the_sub_field('book_title'); ?></a> (<?php the_sub_field('year_of_publication'); ?>)</li>
- <?php
- endwhile;
- else :
- // no rows found
- endif;
- ?>
- </ol>
- <?php
- // check if the Publication repeater field has rows of data
- if( have_rows('book') ):
- // loop through the rows of data
- while ( have_rows('book') ) : the_row(); ?>
- <a name="<?php the_sub_field('book_title'); ?>"></a>
- <h3><?php the_sub_field('book_title'); ?> (<?php the_sub_field('type'); ?>)</h3>
- <?php if (get_sub_field('magazine_name') ): ?>
- <p style="margin-bottom: .5em;">Publication: <?php the_sub_field('magazine_name'); ?>
- <?php endif; ?>
- <?php if (get_sub_field('issue_date') ): ?>
- <p style="margin-bottom: .5em;">Issue Date: <?php the_sub_field('issue_date'); ?>
- <?php endif; ?>
- <?php if (get_sub_field('issue') ): ?>
- <p style="margin-bottom: .5em;">Issue No: <?php the_sub_field('issue'); ?>
- <?php endif; ?>
- <?php if (get_sub_field('volume') ): ?>
- <p style="margin-bottom: .5em;">Volume No: <?php the_sub_field('volume'); ?>
- <?php endif; ?>
- <img width="25%" src="<?php the_sub_field('cover_image'); ?> ">
- <p>Year of publication: <?php the_sub_field('year_of_publication'); ?>
- <?php if (get_sub_field('publisher') ): ?>
- <p>Publisher: <?php the_sub_field('publisher'); ?>
- <?php endif; ?>
- <?php if (get_sub_field('subgenre') ): ?>
- <p>Genre: <?php the_sub_field('subgenre'); ?>
- <?php endif; ?>
- <p>Description: <?php the_sub_field('book_description'); ?>
- <?php // check for book links (sub repeater)
- if( have_rows('book_link') ): ?>
- <h3>Publication Links</h3>
- <?php
- // loop through rows (sub repeater)
- while( have_rows('book_link') ): the_row();
- // display each item as a list - with a class of completed ( if completed ) ?>
- <a href="<?php the_sub_field('book_link'); ?>">
- <?php the_sub_field('link_name'); ?></a><br />
- <?php endwhile; ?>
- <?php endif; //if( get_sub_field('book_link') ): ?>
- <center><a href="#top-of-list">Back to top of list</a></center>
- <hr />
- <?php
- endwhile;
- else :
- // no rows found
- endif;
- ?>
- </div>
Add Comment
Please, Sign In to add comment