WordPress.org

Ready to get started?Download WordPress

Forums

Add Posts To Pages By Tag. (7 posts)

  1. Gemma017
    Member
    Posted 1 year ago #

    Hi everybody. Firstly an apology if my terminology is incorrect. I will try to explain what I need in simple terms.

    I have a blog which has a header in which page titles (one word) are displayed. When that page has some content, the page is displayed to all viewers.

    Each of those pages has a title that is also used as a category on my site.

    I would like to add posts to these pages that are tagged under that category.

    What php code do I need to add to the page.php so that these will be displayed along with a brief introductory text that is permanent.

    I hope you don't mind that I am asking this as I have spent most of the morning trying to discover this without success.

  2. esmi
    Forum Moderator
    Posted 1 year ago #

  3. Gemma017
    Member
    Posted 1 year ago #

    Thanks, Esmi!

    I am going to try that - in the mean time, this is the current page.php code:

    <?php get_header(); ?>
    
    	<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<div class="post_title"><h2><?php the_title(); ?></h2></div>
    			<?php edit_post_link('Edit this page', '<div class="post_date">', '</div>'); ?>
    			<div class="post_body">
    				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    
    				<div class="clearer">&nbsp;</div>
    			</div>
    
    			<?php wp_link_pages(array('before' => '<div class="post_meta archive_pagination"><strong>Pages:</strong> ', 'after' => '</div>', 'next_or_number' => 'number')); ?>
    
    		</div>
    
    		<?php endwhile; ?>
    
    	<?php else : ?>
    
    		<h2>Not Found</h2>
    		<p>Sorry, but you are looking for something that isn't here.</p>
    		<?php get_search_form(); ?>
    
    	<?php endif; ?>	
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    What might I add just to get a list of posts under the initial text?

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    Please try re-reading the page I linked above. You have to start by creating a custom page template.

  5. Gemma017
    Member
    Posted 1 year ago #

    Okay ...

  6. Gemma017
    Member
    Posted 1 year ago #

    I am so sorry to have asked the wrong question, Esmi. Your helpful pages haven't really helped at all.

    No doubt you are correct that I must create a custom page. That, no doubt seals the question and will be deemed solved thereby. I thankyou.

  7. Gemma017
    Member
    Posted 1 year ago #

    I now use another forum for WordPress help. There are forums where people actually know how to use the WordPress interface.

Topic Closed

This topic has been closed to new replies.

About this Topic