feat: Add article template for custom post type
Introduced a new template for custom article posts, displaying title, authors, note, abstract, and various sections like Introduction, Methods, Results, Discussion, Conclusion, and References. Enhances readability and structure for article content.
This commit is contained in:
parent
f6e4824fe5
commit
b9e8ff9486
1 changed files with 50 additions and 0 deletions
50
article-template.php
Normal file
50
article-template.php
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
Template Name: Article Template
|
||||||
|
Template Post Type: article
|
||||||
|
*/
|
||||||
|
get_header();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!-- Article Content -->
|
||||||
|
<section class="container my-5">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-8 mx-auto">
|
||||||
|
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
|
||||||
|
<h1 class="display-4"><?php the_title(); ?></h1>
|
||||||
|
<p class="text-muted">
|
||||||
|
<?php
|
||||||
|
$authors = get_post_meta(get_the_ID(), 'article_authors', true);
|
||||||
|
if (!empty($authors)) {
|
||||||
|
echo implode(', ', array_map('esc_html', $authors));
|
||||||
|
} else {
|
||||||
|
the_author();
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
<p><strong>Note:</strong> The full paper is available for download for subscribers only.</p>
|
||||||
|
<p><strong>Abstract:</strong> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in venenatis enim. In hac habitasse platea dictumst. Nunc ut sapien nec mauris pretium gravida.</p>
|
||||||
|
<hr />
|
||||||
|
<h2>Introduction</h2>
|
||||||
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in venenatis enim. In hac habitasse platea dictumst. Nunc ut sapien nec mauris pretium gravida...</p>
|
||||||
|
<h2>Methods</h2>
|
||||||
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in venenatis enim. In hac habitasse platea dictumst. Nunc ut sapien nec mauris pretium gravida...</p>
|
||||||
|
<h2>Results</h2>
|
||||||
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in venenatis enim. In hac habitasse platea dictumst. Nunc ut sapien nec mauris pretium gravida...</p>
|
||||||
|
<h2>Discussion</h2>
|
||||||
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in venenatis enim. In hac habitasse platea dictumst. Nunc ut sapien nec mauris pretium gravida...</p>
|
||||||
|
<h2>Conclusion</h2>
|
||||||
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in venenatis enim. In hac habitasse platea dictumst. Nunc ut sapien nec mauris pretium gravida...</p>
|
||||||
|
<h2>References</h2>
|
||||||
|
<ul class="list-unstyled">
|
||||||
|
<li>Author, A. (Year). Title of the paper. Journal Name, Volume(Issue), pages.</li>
|
||||||
|
<li>Author, B., & Author, C. (Year). Title of the paper. Journal Name, Volume(Issue), pages.</li>
|
||||||
|
<li>Author, D. (Year). Title of the paper. Journal Name, Volume(Issue), pages.</li>
|
||||||
|
</ul>
|
||||||
|
<?php endwhile;
|
||||||
|
endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<?php get_footer(); ?>
|
Loading…
Reference in a new issue