• I need to change Older Entries and Newer Entries (to Next Page & Previous Page). My notes say, “edit wp-content/themes/name/archive.php, index.php, single.php, tag.php” (tag singular). “Find the line <?php the_content(whatever I want…); ?> “and change to what I want.

    Now I just went to one site and don’t have tag.php or archive.php. In single.php, I see

    <?php the_content(); ?>
    	<div id="postdetails">

    So obviously the notes given to me are theme-specific.

    And, I want to change Read More (to Click To Continue). I have notes that say page.php and tags.php. I have page.php only and the notes say, ” ” and change to what you wantfind <?php the_content(‘<p class=”serif”>Read the rest of this page»</p>;”

    Page.php has

    <?php the_content(); ?>
    	<?php //comments_template(); ?>
    </div>

    So .. if these changes are theme-specific, where can I look for the 2 word groups I want to change … in general? Hopefully I typed all code correctly but you get the gist of what I need to do to 8 different themes. I’m hoping these word groups are generally in the same files.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey Sick Squirrel,

    Check out the Template Hierarchy, while themes can have a number of files like tag.php and single.php for specific pages, the only required files are index.php and style.css, so you probably won’t find all of those files.

    Also check out this Codex article on how the WordPress loop (which creates the posts) works.

    The “Read more” text is based on what’s between the () in <?php the_content(); ?> – since nothing is specified in your theme, I’m guessing WordPress falls back on it’s default “Read more” message, so go ahead and insert your own message in there, like so:

    <?php the_content('Read the rest of this entry &raquo;'); ?>

    To change the Next/Previous links, you’ll need to find and modify this code:

    <?php previous_posts_link('&laquo; Previous Entries') ?><?php next_posts_link('Next Entries &raquo;','') ?>

    Hope this helps. Let me know if anything is confusing.

    Thread Starter SickSquirrel

    (@sicksquirrel)

    A bit confusing 🙂 But thank you as I might have figured it out.

    I edit page.php and change <?php the_content(); ?> to <?php the_content(Click to continue); ?>

    If so, that’s half the battle and simple

    Edit: I found in functions.php `function new_excerpt_more( $more ) {
    return ‘ <a class=”read-more” href=”‘. get_permalink( get_the_ID() ) . ‘”>Read More</a>’;}`

    Change or ignore? If change, then 2 file changes for each theme’s Read More?

    Then, <?php previous_posts_link(‘« Previous Entries’) ?><?php next_posts_link(‘Next Entries »’,”) ?> needs to be found and edited. Which file(s) should I search for that?

    Edit: I searched all php under theme/. In index.php I found <?php endwhile; ?><p id="postnav"> <?php next_posts_link('Older Entries'); ?> &nbsp; <?php previous_posts_link('Newer Entries'); ?></p>

    So I’d change it to <?php endwhile; ?><p id=”postnav”><?php next_posts_link(‘Next Page’); ?>   <?php previous_posts_link(‘Previous Page’); ?></p>

    Change index.php only in each theme?

    Note: Since 1995 (except for 2008-2011 while in coma) I have complained that Next & Previous were reversed in most themes.

    <?php endwhile; ?>
    <p id=”postnav”>
    <?php next_posts_link(‘Older Entries’); ?>  
    <?php previous_posts_link(‘Newer Entries’); ?>
    </p>

    next_posts = OLDER?
    previous_posts=NEWER?

    I had about 50 WP sites back then and I’d have to change every theme because of that. Despite my loss of memory, I never forgot that.

    Again, thank you. I feel close to a finish with lots of editing ahead.

    next_posts = OLDER?
    previous_posts=NEWER?

    I would guess that is because the next one you will see as you scroll down the page is the one that had been at the top yesterday! 😉

    Thread Starter SickSquirrel

    (@sicksquirrel)

    Odal, I went to try to fix this on a test site but remembered you hadn’t answered a couple of questions I had. Would you please look over my inquiries so I can do this right the first time and not end up crying?

    Hey Squirrel, sorry, I forgot to reply to your other post.

    I’m not clear on what your questions are though, because it looks like you edited the post a few times.

    Thread Starter SickSquirrel

    (@sicksquirrel)

    Sorry I wasn’t clear. I rushed to type in my excitement of a solution!

    I’m going to try to put each question in a code section to separate them. I’m hoping it works.

    I edit page.php and change <?php the_content(); ?> to <?php the_content(Click to continue); ?>
    
    If so, that's half the battle and simple
    
    Edit: I found in functions.php
    
    function new_excerpt_more( $more ) {
    return ' <a href="'. get_permalink( get_the_ID() ) . '">Read More</a>';}
    
    Change or ignore? If change, then 2 file changes for each theme's Read More?
    Then, <?php previous_posts_link('« Previous Entries') ?><?php next_posts_link('Next Entries »','') ?> needs to be found and edited. Which file(s) should I search for that?
    Edit: I searched all php under theme/. In index.php I found <?php endwhile; ?><p id="postnav">	<?php next_posts_link('Older Entries'); ?>   <?php previous_posts_link('Newer Entries'); ?></p>
    
    So I'd change it to <?php endwhile; ?><p id="postnav"><?php next_posts_link('Next Page'); ?>   <?php previous_posts_link('Previous Page'); ?></p>

    Change index.php only in each theme?
    `

    Thread Starter SickSquirrel

    (@sicksquirrel)

    The last section I can’t edit but the last line belongs above to the last section of code.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Which 2 files do I edit?’ is closed to new replies.