Support » Fixing WordPress » Anyway to add text before and after post…

  • Hi,

    Is there any way to automatically add text before and after a post, because I’m trying to get onto some news reader website, but they require me to put in

    and

    in my posts… so is there anyway? It takes me ages to do it manually!

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter saaretjie

    (@saaretjie)

    Sorry

    what they require is

    article start and article end in each post

    You’ll have to edit the loop on your main index template. have a look here.

    could you not just alter the single.php file so its always there. this’d only work though if you were putting it on EVERY post.

    I’m not exactly sure how wordpress generates feeds but that should work.

    Thread Starter saaretjie

    (@saaretjie)

    Can someone please tell me where to put it? I’m a total noob if you haven’t worked it out already.

    Here’s a copy of my single.php… I’m using the Prosumer theme from jauhari…

    <?php get_header(); ?>
    <div id=”content” class=”widecolumn”>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <h2>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”>
    <?php the_title(); ?>
    </h2>
    <p class=”meta”>
    <span class=”timr”><?php the_time(‘F d, Y’) ?></span>
    <span class=”user”>By: <?php the_author() ?> </span>
    <span class=”catr”>Category: <?php the_category(‘, ‘) ?></span>
    <?php edit_post_link(‘Edit’, ‘<span class=”editr”>’, ‘</span>’); ?>
    </p>
    <div class=”entry”>
    <?php the_content(‘<p class=”serif”>Read the rest of this entry »</p>’); ?>
    <?php wp_link_pages(array(‘before’ => ‘<p>Pages: ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>
    </div>
    </div>
    <?php comments_template(); ?>
    <?php endwhile; else: ?>
    <p>Sorry, no posts matched your criteria.</p>
    <?php endif; ?>
    <div class=”navigation”>
    <div class=”alignleft”>
    <?php previous_post_link(‘← %link’) ?>
    </div>
    <div class=”alignright”>
    <?php next_post_link(‘%link →’) ?>
    </div>
    </div>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    You can put it above and below this line
    <?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>
    So it would look like this

    Above Code
    <?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>
    Below Code

    Thread Starter saaretjie

    (@saaretjie)

    Thank you so much!

    You’ve all been amazing help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Anyway to add text before and after post…’ is closed to new replies.