Link to home
Start Free TrialLog in
Avatar of Amanda Watson
Amanda WatsonFlag for Australia

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?
Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

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.
Avatar of Amanda Watson

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('&laquo; %link'),

								'prev_link' => theme_get_next_post_link('%link &raquo;')

							)

						);

					}

					

					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('&laquo; %link'),

								'prev_link' => theme_get_next_post_link('%link &raquo;')

							)

						);

					}

					

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

Open in new window

Hi Snoball, you can replace the current prev_link and the next_link with this:

                  
<li><?php previous_post_link( '&#x300A; %link','Your Previous Post Text',false) ?></li>
 <li><?php next_post_link(' %link &#x300B;','Your Next Posts Text', false) ?></li>

Open in new window


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.
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?
<?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('&laquo; %link'),

								'prev_link' => theme_get_next_post_link('%link &raquo;')

							)

						);

					}

					

					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('&laquo; %link'),

								'prev_link' => theme_get_next_post_link('%link &raquo;')

							)

						);

					}

					

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

Open in new window

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
ASKER CERTIFIED SOLUTION
Avatar of jeremyjared74
jeremyjared74
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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?

Plus the next isn't disappearing when there is no more to show?
got it sorted thank you
array(
        'next_link' => theme_get_previous_post_link('&laquo; %link', 'NEXT', false),
        'prev_link' => theme_get_next_post_link('%link &raquo;', 'PREVIOUS', false)
        ));
        }
OK Try this one:

<?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 &amp;raquo;');  ?>
    <?php next_posts_link('&amp;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(); ?>

Open in new window


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.
Thank you for your help ;-)
You're welcome.