• I want to be able to add a new page and add custom text at the top, then have all my posts with a particular tag (“London” for example) show up at the bottom. Am I able to do this within the Page function? If so, what is the code to do so?

    I want to do this rather than creating unique .php files for each new tag page.

    Thanks,

    Matt

    ___________

    Here’s my archives.php text:

    [please review http://codex.wordpress.org/Forum_Welcome#Posting_Code about how to post code in the forum – the code below got partially broken by the forum parser]

    <?php
    get_header();
    ?>
    <div id="content-wrapper" class="large">
      <div id="col-wrapper">
        <div id="col-1">
          <?php if(dtw_check_option('ad_468x60_above_recent_posts')) { ?>
          <div class="adblock-wrapper" style="margin-bottom: 25px;">
            <?php echo get_option('dtw_ad_468x60_above_recent_posts'); ?>
          </div>
    
              <?php } ?>
    
    <div class="breadcrumbs">
    <?php if ( function_exists('yoast_breadcrumb') ) {
    yoast_breadcrumb('<p id="breadcrumbs">','</p>');
    } ?>
    </div>
    
    <div id="cattitlecolor"><span class="h7"><?php single_cat_title(); ?>​​</h7></div>
    <div class="clear"></div>
    
    <div class="border2" style="border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; "></div>
    
          <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <div class="buttons">
    <ul id="buttonlist">
    
    <li><div class="" style="float:right; padding-top:0px;"><a href="http://twitter.com/share">" data-text="<?php the_title(); ?>" data-count="horizontal" data-via="TheExpeditioner">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
    </li>
    <li>
    <iframe src="http://www.facebook.com/plugins/like.php?href=<?php the_permalink(); ?>&layout=button_count&show_faces=false&width=75&action=like&font=verdana&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; float:right; overflow:hidden; width:100px; height:20px"></iframe>
    </li>
    </div>
    
            <div class="post">
    
              <div class="mobile-article-title"><a>"><?php the_title(); ?></a></div>
    
     <span class="thumbnail"><a>">
            <?php
    		if(has_post_thumbnail()) {
    			the_post_thumbnail();
    		} elseif(get_post_meta($post->ID, 'post_thumbnail_value', true) != '') { ?>
    			<img class="post-image" src="<?php bloginfo('template_directory') ?>/timthumb.php?src=<?php echo get_post_meta($post->ID, 'post_thumbnail_value', true); ?>&w=154&h=154&zc=1" alt="<?php the_title(); ?>" />
    
    </a>
    		<?php } ?>
    </span>
    
              <h1 class="post-title"><a>"><?php the_title(); ?></a></h1>
              <div class="postmetadata">
                <p class="date">Posted on <?php the_time('F d, Y'); ?></p>
              </div>
              <div class="entry">
              <div class="frontpageexcerpt">
                <?php the_excerpt(); ?>
                </div>
    <div class="clear"></div>
    
              </div>
            </div>
    
            <div class="border1"></div>
    
          <?php endwhile; ?>
    
    <?php wp_pagenavi(); ?>
    
          <?php else: ?>
          <div class="post">
            <div class="entry">
              <?php
              if ( is_category() ) { // If this is a category archive
                printf("<h2 class='center'>Sorry, but there aren't any posts in the %s category yet.</h2>", single_cat_title('',false));
              } else if ( is_date() ) { // If this is a date archive
                echo("<h2>Sorry, but there aren't any posts with this date.</h2>");
              } else if ( is_author() ) { // If this is a category archive
                $userdata = get_userdatabylogin(get_query_var('author_name'));
                printf("<h2 class='center'>Sorry, but there aren't any posts by %s yet.</h2>", $userdata->display_name);
              } else {
                echo("<h2 class='center'>No posts found.</h2>");
              }
              get_search_form();
              ?>
            </div>
          </div>
          <?php endif; ?>
        </div>
        <?php if(dtw_check_option('ad_468x60_below_recent_posts')) { ?>
        <div class="clear"></div>
        <div class="adblock-wrapper">
          <?php echo get_option('dtw_ad_468x60_below_recent_posts'); ?>
        </div>
        <?php } ?>
      </div>
      <?php get_sidebar(); ?>
    </div>
    <?php
    get_footer();
  • The topic ‘Return Posts By Tag In Page At Bottom’ is closed to new replies.