WordPress.org

Ready to get started?Download WordPress

Forums

Anyway to add text before and after post... (8 posts)

  1. saaretjie
    Member
    Posted 7 years ago #

    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!

  2. saaretjie
    Member
    Posted 7 years ago #

    Sorry

    what they require is

    article start and article end in each post

  3. Jeremy Clark
    Moderator
    Posted 7 years ago #

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

  4. Alex Cragg
    Member
    Posted 7 years ago #

    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.

  5. Jeremy Clark
    Moderator
    Posted 7 years ago #

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

  6. saaretjie
    Member
    Posted 7 years ago #

    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(); ?>

  7. Jeremy Clark
    Moderator
    Posted 7 years ago #

    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
  8. saaretjie
    Member
    Posted 7 years ago #

    Thank you so much!

    You've all been amazing help!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.