keep title/format from different page on tag.php
-
So I have a projects page that queries a list of posts and a list of tags that the posts are categorized by. How do I make my tag.php page keep the same appearance and title as the projects page?
The problem Im running into is that tag.php loads the title from the individual post, not that of the projects page.
Also the list on tag.php is not updating to show only the tags selected.
This is the code I’m using for both the projects page and tag.php, minus the template name. I’m not sure what I should be changing on tag.php to make this work. Any advice appreciated, thanks,
<?php /* Template Name: Projects Page */ ?> <?php get_header(); the_post(); ?> <div class="left"> <div class="header-shadow"> <div class="header-bg"> <p class="header-text"><?php the_title(); ?></p> <p class="sub-header-text-gray"><?php echo get_post_meta($post->ID, 'description', true); ?></p> </div> </div> <div class="content-wider"> <div class="project-tags-holder"> <span class="project-tags">Sort By:</span> <span class="project-tags"><a href="?page_id=8">All</a></span> <?php $tags = get_tags( array('orderby' => 'count', 'order' => 'DESC') ); foreach ( (array) $tags as $tag ) { echo '<span class="project-tags"><a href="' . get_tag_link ($tag->term_id) . '" rel="tag">' . $tag->name . ' (' . $tag->count . ') </a></span>'; } ?> </div> <?php $args = array('category' => '5', 'posts-per-page=5'.'&paged='.$paged); $myposts = get_posts( $args ); foreach ( $myposts as $post ) : setup_postdata( $post ); ?> <div class="projects-list"> <div class="projects-img"><img src="<?php echo get_post_meta($post->ID, 'project-image', true); ?>" style="width:50px; height:50px;" /></div><b><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></b><br /><?php the_excerpt(); ?> </div> <div class="long-sep"></div> <br clear="all" /> <?php endforeach; wp_reset_postdata();?> </div> </div> <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘keep title/format from different page on tag.php’ is closed to new replies.