Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 366
  • Last Modified:

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?
0
Amanda Watson
Asked:
Amanda Watson
  • 7
  • 4
1 Solution
 
Jason C. LevineNo oneCommented:
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.
0
 
Amanda WatsonAuthor Commented:
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

0
 
jeremyjared74Commented:
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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Amanda WatsonAuthor Commented:
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

0
 
Amanda WatsonAuthor Commented:
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
0
 
jeremyjared74Commented:
OK this should work unless the theme has some type of special function that is is canceling it 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')) {
      theme_page_navigation(
      array(
        'next_link' => theme_get_previous_post_link(' %link &#x300B;', 'Your Next Posts Text', false), 
        'prev_link' => theme_get_next_post_link('&#x300A; %link', 'Your Previous Post Text', false)
        ));
        }
  } 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

0
 
Amanda WatsonAuthor Commented:
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?

0
 
Amanda WatsonAuthor Commented:
Plus the next isn't disappearing when there is no more to show?
0
 
Amanda WatsonAuthor Commented:
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)
        ));
        }
0
 
jeremyjared74Commented:
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.
0
 
Amanda WatsonAuthor Commented:
Thank you for your help ;-)
0
 
jeremyjared74Commented:
You're welcome.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now