Removing the “Older Posts” Line?
-
I would like to remove the link that appears at the top of the page that shows the older posts. I like that this link is at the bottom of my posts but I don’t like it at the top.
Is there a way to remove this link?
-
If you look in your index.php file you should see something that resembles this code above your loop and below it. Just remove the one above the loop:
<div class=”navigation”>
<div class=”left”><?php next_posts_link(‘« Older Posts’) ?></div>
<div class=”right”><?php previous_posts_link(‘Newer Posts »’) ?></div>
</div>Is there a way to keep the Previous post link that is at the bottom of the page and remove the one from the top?
That code should be in two places: once before the main Loop, and once after it. You can just delete the one above the loop and leave the bottom one alone.
I only found this code once — it was in functions.php
<div class=”<?php echo $naviclass; ?>”>
<div class=”navleft”><?php next_posts_link(‘« ‘ . __(‘Older Posts’, ‘chameleon’)) ?></div>
<div class=”navright”><?php previous_posts_link(__(‘Newer Posts’, ‘chameleon’) . ‘ »’); ?></div>
</div>When I delete this, it removes the Older Posts link at the bottom of the page too.
Don’t mess with anything in functions.php.
That’s where the functions are defined – which are getting called from your other pages.
Are you using home.php instead of index.php? Look for that.
You need to find where that function call is coming from. It could be getting called from your header.php file, if that’s how that theme was designed.
Basically, your Theme has been broken down into several parts:
The main one is either index.php or home.php and it pulls in the following files:
header.php
sidebar.php
footer.php… and possibly others.
In my index.php, from my index.php, it goes like this:
get_header() – pulls in the header file
then comes the main loop inside index.php
after the main loop it calls that function you’re looking for: ** <?php next_posts_link() **then it calls
get_sidebar()
get_footer()So my next_post_link() is getting called from index.php. Check to see what pages are being called before the main loop in your index.php (or in home.php if you don’t have an index.php). If the only thing above your main loop is a get_header() call, then check inside header.php, and see if it’s in there.
Not sure if I’m making this clear or just complicating it for you.
As CallUp said, you have to remove the first instance of the shown code in the file single.php and if you don’t want the top in the archives pages, remove it also from loop.php
I will get track of this to make it an option for the next them version. You can follow whats happening with this issue at https://tracker.alkivia.org/view.php?id=171
This has been included as a setting. I submited it to be released as version 1.1
I found “Older Posts” button is on the left side is odd, that is not intuitive from the ergonomics perspective.
I think using “Back” and “Next” is more user-friendly.
Suggestion for any web designer, put another HOME button at the right bottom corner will save a little time for moving cursor back to the left top corner.
If a single netizen can save 1 second for such each motion, a billion surfers in the world can a several billion of seconds each day.
nkk,
The thing about “back” and “next” is that it can confuse the reader as far as what “back” represents.For instance the “back” button on your browser takes you to the last page you were on. It doesn’t distinguish between whether that last page you were on contains more recent posts or older posts, and therein lies the potential confusion: Is the “back” button taking you to the page you were just on, even if you were just on a page with the more recent posts than the one you’re on now?
By better articulating the time line of the page it is taking you too (a page with more recent posts vs a page with more older posts) that clarifies that confusion.
As far as that button being on the left or right of the screen, you might have a point there.
Having said all this, if you go into the page that contains this function call, it takes as arguments (in quotes) exactly what you want it to say. You can change “Older posts” to “next” or to “back” if that seems clearer to you.
I agree “back” is a bit confusing. “Previous” shall be a better choice.
I swap the location and arrow of both buttons by interchanging “left” and “right” and coding lines in functions.php. It works fine.
<div class=”<?php echo $naviclass; ?>”>
<div class=”navleft”><?php next_post_link(‘%link «’) ?></div>
<div class=”navright”><?php previous_post_link(‘» %link’) ?></div>
</div>
<?php } elseif ( function_exists(‘wp_pagenavi’) ) {
$naviclass = ( ‘bottom-navigator’ == $class ) ? ‘pagenavi-container pagenavi-bottom’ : ‘pagenavi-container’;
echo ‘<div class=”‘. $naviclass .'”>’;
wp_pagenavi();
echo ‘</div>’<div class=”<?php echo $naviclass; ?>”>
<div class=”navleft”><?php previous_posts_link(__(‘Newer Posts’, ‘chameleon’) . ‘ «’); ?></div>
<div class=”navright”><?php next_posts_link(‘» ‘ . __(‘Older Posts’, ‘chameleon’)) ?></div>
- The topic ‘Removing the “Older Posts” Line?’ is closed to new replies.