Home Forums Front-end Issues Display custom field data at end of post?


Display custom field data at end of post?

  • Hi, I have created two custom fields and can show them in the post no problem, the only problem is that they display below things like share buttons, author box, etc. How can I get them to show above these things, directly after the final paragraph of the post?

    This is my code:

    <?php if( get_field('review_score') ): ?>
    								<div class="review-score">
                                    	<h1>The Last Word</h1>
                                    	<div class="score-section">
    									<span class="review-the-score"><?php the_field('review_score'); ?></span><span class="review-out-of">/10</span>
                                        <div class="summary-section">
                                        <span class="review-summary"><?php the_field('review_summary'); ?></span></div>
    							<?php endif; ?>
  • That would depend on your theme and how these other things are being added. It may or may not be possible, but I can’t tell from the code provided. Basically, you need to find the place in the code where the content is displayed and figure out how to add your field content after that.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Display custom field data at end of post?’ is closed to new replies.