Amanda Watson
asked on
How can I move my previous article link to the bottom of the post?
Hi, on this page here
http://seniorfootcare.ey3host.com/2011/10/the-latest-on-podiatry/
You will see there is s link to the next article above the article
I would like ot change this to say PREVIOUS and NEXT and be placed at the bottom of the post
How can I do this?
http://seniorfootcare.ey3host.com/2011/10/the-latest-on-podiatry/
You will see there is s link to the next article above the article
I would like ot change this to say PREVIOUS and NEXT and be placed at the bottom of the post
How can I do this?
You'll need to edit the single.php file for your theme. Once there, look for <div class="navigation"> and inside it you will see the code that generates the link. Move the div to where ever you want it to be and change the text inside the <a> tags to whatever you want.
ASKER
I dont' think that is going to work because it can't really be moved...see my single.php page
<?php get_header('blog'); ?>
<div class="art-content-layout">
<div class="art-content-layout-row">
<div class="art-layout-cell art-content">
<?php get_sidebar('top'); ?>
<?php
if (have_posts()){
/* Display navigation to next/previous posts when applicable */
if (theme_get_option('theme_top_single_navigation')) {
theme_page_navigation(
array(
'next_link' => theme_get_previous_post_link('« %link'),
'prev_link' => theme_get_next_post_link('%link »')
)
);
}
while (have_posts())
{
the_post();
get_template_part('content', 'single');
comments_template();
}
/* Display navigation to next/previous posts when applicable */
if (theme_get_option('theme_bottom_single_navigation')) {
theme_page_navigation(
array(
'next_link' => theme_get_previous_post_link('« %link'),
'prev_link' => theme_get_next_post_link('%link »')
)
);
}
} else {
theme_404_content();
}
?>
<?php get_sidebar('bottom'); ?>
<div class="cleared"></div>
</div>
<div class="art-layout-cell art-sidebar1">
<div class="art-layout-glare">
<div class="art-layout-glare-image"></div>
</div>
<?php get_sidebar('default'); ?>
<div class="cleared"></div>
</div>
</div>
</div>
<div class="cleared"></div>
<?php get_footer(); ?>
Hi Snoball, you can replace the current prev_link and the next_link with this:
The first part in the ' ' marks is just the >> arrows,
the second parameter (or the first if it's the next_post) is:
%link It's the actual link to the posts.
The third parameter allows you to add a custom title:
'Your Next Posts Text'
This allows for custom text.
Finally the final parameter is either true or false . True shows the title for the next/previous posts while false doesn't.
<li><?php previous_post_link( '《 %link','Your Previous Post Text',false) ?></li>
<li><?php next_post_link(' %link 》','Your Next Posts Text', false) ?></li>
The first part in the ' ' marks is just the >> arrows,
the second parameter (or the first if it's the next_post) is:
%link It's the actual link to the posts.
The third parameter allows you to add a custom title:
'Your Next Posts Text'
This allows for custom text.
Finally the final parameter is either true or false . True shows the title for the next/previous posts while false doesn't.
ASKER
Ok I tried your code there but it didn't seem to work - it just showd the two bullet points.
This is the code of single.php - do you see how it can work?
This is the code of single.php - do you see how it can work?
<?php get_header('blog'); ?>
<div class="art-content-layout">
<div class="art-content-layout-row">
<div class="art-layout-cell art-content">
<?php get_sidebar('top'); ?>
<?php
if (have_posts()){
/* Display navigation to next/previous posts when applicable */
if (theme_get_option('theme_top_single_navigation')) {
theme_page_navigation(
array(
'next_link' => theme_get_previous_post_link('« %link'),
'prev_link' => theme_get_next_post_link('%link »')
)
);
}
while (have_posts())
{
the_post();
get_template_part('content', 'single');
comments_template();
}
/* Display navigation to next/previous posts when applicable */
if (theme_get_option('theme_bottom_single_navigation')) {
theme_page_navigation(
array(
'next_link' => theme_get_previous_post_link('« %link'),
'prev_link' => theme_get_next_post_link('%link »')
)
);
}
} else {
theme_404_content();
}
?>
<?php get_sidebar('bottom'); ?>
<div class="cleared"></div>
</div>
<div class="art-layout-cell art-sidebar1">
<div class="art-layout-glare">
<div class="art-layout-glare-image"></div>
</div>
<?php get_sidebar('default'); ?>
<div class="cleared"></div>
</div>
</div>
</div>
<div class="cleared"></div>
<?php get_footer(); ?>
ASKER
Ok I just realised that the bottom links can be shown by changing my theme options!!
Now I just need to change them to say NEXT or PREVIOUS
Now I just need to change them to say NEXT or PREVIOUS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes getting close
http://seniorfootcare.ey3host.com/2011/10/the-latest-on-podiatry/
Only problem is they are in the wrong position?
See above link?
http://seniorfootcare.ey3host.com/2011/10/the-latest-on-podiatry/
Only problem is they are in the wrong position?
See above link?
ASKER
Plus the next isn't disappearing when there is no more to show?
ASKER
got it sorted thank you
array(
'next_link' => theme_get_previous_post_li nk('« ; %link', 'NEXT', false),
'prev_link' => theme_get_next_post_link(' %link »', 'PREVIOUS', false)
));
}
array(
'next_link' => theme_get_previous_post_li
'prev_link' => theme_get_next_post_link('
));
}
OK Try this one:
That should take care of it not showing when there are no previous or next posts. If that works, but their on the wrong sides, we can easily wrap it with a div or a span tag to apply css to it. Or you could even use the class that WP assigns to the pagination and use the :first-child selector to float left and right. If you get that far and can't figure it out let me know and I'll help you out.
<?php get_header('blog'); ?>
<div class="art-content-layout">
<div class="art-content-layout-row">
<div class="art-layout-cell art-content"><?php get_sidebar('top'); ?>
<?php if (have_posts()) {
while (have_posts()) {
the_post();
get_template_part('content', 'single'); comments_template();
}
?>
<?php
if (theme_get_option('theme_bottom_single_navigation')) {
global $wp_query;
if ($wp_query->max_num_pages > 1)
?>
<div class='navigation'>
<?php previous_posts_link('Newer Entries &raquo;'); ?>
<?php next_posts_link('&laquo; Older Entries'); ?>
</div>
<?php }
} else {
theme_404_content(); } get_sidebar('bottom'); ?>
<div class="cleared"></div>
</div>
<div class="art-layout-cell art-sidebar1">
<div class="art-layout-glare">
<div class="art-layout-glare-image"></div>
</div><?php get_sidebar('default'); ?>
<div class="cleared"></div>
</div>
</div>
</div>
<div class="cleared"></div>
<?php get_footer(); ?>
That should take care of it not showing when there are no previous or next posts. If that works, but their on the wrong sides, we can easily wrap it with a div or a span tag to apply css to it. Or you could even use the class that WP assigns to the pagination and use the :first-child selector to float left and right. If you get that far and can't figure it out let me know and I'll help you out.
ASKER
Thank you for your help ;-)
You're welcome.