Custom theme, how do i add tags/author name to end of every post
-
Hey guys, im new to whole wordpress world and im loving every minute of it, i’ve recently set up a blog using a custom theme. It does not however show tags or the name of the author who posted (i have two authors on the site both have posted more than once) i have read up on the forums about inserting codes into the index.php (or loop file) but everytime i have done so it either displays the tag/author information outside of the post itself (onto the main body of the site) or directly at the bottom of the page (not the individual posts)
Here is the code for the index.php:
<?php get_header(); ?> <!--Blog--> <div id="blog" class="clearfix"> <!--Articles--> <div class="articles"> <?php if (have_posts()) : while (have_posts()) : the_post(); $format = get_post_format(); ?> <?php if($format == ''): ?> <?php get_template_part('library/functions/theme/formats/standar'); ?> <?php else: ?> <?php get_template_part('library/functions/theme/formats/'.$format); ?> <?php endif; ?> <?php endwhile ?> <?php else: ?> <h2>No posts were found.</h2> <?php endif ?> <!--End .articles--> </div> <?php if(page_has_nav()) : ?> <!--Navigation--> <div id="postnavigation" class="clearfix"> <!--Previous--> <span class="prev"><?php previous_posts_link('« Previous') ?></span> <!--Next--> <span class="next"><?php next_posts_link('Next »','') ?></span> <!--End .navigation--> </div> <?php endif; ?> <!--Sidebar--> <div id="sidebar"> <?php get_sidebar(); ?> <!--End .sidebar--> </div> <!--End #blog--> </div> <?php get_footer(); ?>
and here is the code for the standar.php
<!--Article--> <div <?php post_class("article standard clearfix"); ?>> <!--Date--> <div class="date"> <a title="<?php the_title(); ?>" href="<?php the_permalink() ?>"><?php the_date('M.j.Y'); ?></a> </div> <!--Content--> <div class="content clearfix"> <!--Title--> <?php $title = get_post_meta($post->ID, 'post_header', true); if (!$title) $title = $post->post_title; ?> <h2 class="title"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php echo $title; ?></a></h2> <?php the_content("Read the full story"); ?> <?php include("social.php"); ?> <!--End .content--> </div> <!--End .article--> </div>
this is the page.php code
<?php get_header(); ?> <!--Blog--> <div id="blog" class="clearfix"> <!--Articles--> <div class="articles single"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <!--Article--> <div <?php post_class("article standard clearfix"); ?>> <!--Content--> <div class="content clearfix"> <!--Title--> <?php $title = get_post_meta($post->ID, 'post_header', true); if (!$title) $title = $post->post_title; ?> <h2 class="title"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php echo $title; ?></a></h2> <?php the_content("Read the full story"); ?> <!--End .content--> </div> <!--End .article--> </div> <?php endwhile ?> <?php comments_template('', true ); ?> <?php endif ?> <!--End .articles--> </div> <!--End #blog--> </div> <?php get_footer(); ?>
any help would be hugely apreciated! thanks
- The topic ‘Custom theme, how do i add tags/author name to end of every post’ is closed to new replies.