How To Move "previous" And "next" Links To Top Of Page In Wordpress

Discussion in 'CSS' started by printex, Feb 14, 2013.

  1. #1
    I have enabled a very recent WP template named "appliance." Everything works well, except all the important navigation links are at the bottom of each page. At first I thought no big deal, I'll figure it out in one of the the template editors, but so far had no luck.

    Would be very grateful for some advice.
     
    printex, Feb 14, 2013 IP
  2. indyonline

    indyonline Prominent Member

    Messages:
    4,626
    Likes Received:
    248
    Best Answers:
    2
    Trophy Points:
    335
    #2
    just move it in your index.php template. Find the code in the file and move it above the content section.

    Find this:
    <div id="postnavigation">
    <div id="previousposts"><?php next_posts_link( __( 'Previous Entries', 'appliance' ) ); ?></div>
    <div id="nextposts"><?php previous_posts_link( __( 'Next Entries', 'appliance' ) ); ?></div>
    </div>
    Code (markup):
    and move it above this:
    <?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>
    Code (markup):
    there also was a divider above the postnavi, I would put it under it after you move it.
    <div class="divider"></div>
    Code (markup):
     
    Last edited: Feb 14, 2013
    indyonline, Feb 14, 2013 IP
  3. printex

    printex Greenhorn

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
     
    printex, Feb 14, 2013 IP
  4. printex

    printex Greenhorn

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    Thanks very much for your quick reply. I'm going to try it later this evening and will let you know :)
     
    printex, Feb 14, 2013 IP
  5. ArchAxis

    ArchAxis Well-Known Member

    Messages:
    136
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    175
    #5
    You need to look at the code in the header.php and footer.php files of the appliance theme. Look for the
    <?php wp_nav_menu( array( 'theme_location' => 'footer-menu', 'depth' => '1' ) ); ?>
    Code (markup):
    in the footer and place that in the header.php and the WordPress pages will appear on top.

    For the other links also look in the footer.php. The easiest way to find out what the code is doing is to delete something, upload it and see what disappears. You'll also want to learn some basic PHP and read up on WordPress Theme Development.
     
    ArchAxis, Feb 14, 2013 IP
  6. printex

    printex Greenhorn

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #6
    --------------------------------------
    Thanks so much Indy! I made the changes and IT WORKED!!! I really appreciate your help. However I've got one small problem. The "search by category" link doesn't seem to comply. For example I have several dozen posts under "videos" but the "next" and "previous" links aren't showing top or bottom, and I'm getting a hint of a divider running along the bottom posts. The default is currently set at "show 8 posts." Any ideas? TIA
     
    printex, Feb 15, 2013 IP
  7. printex

    printex Greenhorn

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #7
    Thanks so much Indy! I made the changes and IT WORKED!!! I really appreciate your help. However I've got one small problem. The "search by category" link doesn't seem to comply. For example I have several dozen posts under "videos" but the "next" and "previous" links aren't showing top or bottom, and I'm getting a hint of a divider running along the bottom posts. The default is currently set at "show 8 posts." Any ideas? TIA

    Oh, and I forgot to mention that when a link is clicked (ie: photo or text on main page that shows group of 8), it would be nice to see "previous [name] post" at top of page also, perhaps with a "back" link on the opposite side of that new page that's being viewed.

    I know I'm asking a lot but, but I think you're one of the few that really does know WP and of course I would greatly appreciate your help. Thanks
     
    printex, Feb 15, 2013 IP
  8. printex

    printex Greenhorn

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #8
    Thanks ArchAxis! I managed to move the links up to the top of the page by editing the index.php but my "search by category" section doesn't seem to show any links, top or bottom. Any ideas? TIA
     
    printex, Feb 15, 2013 IP
  9. ArchAxis

    ArchAxis Well-Known Member

    Messages:
    136
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    175
    #9
    Just find out which .php file controls the search by category page and add
    <div id="postnavigation">
    <div id="previousposts"><?php next_posts_link( __( 'Previous Entries', 'appliance' ) ); ?></div>
    <div id="nextposts"><?php previous_posts_link( __( 'Next Entries', 'appliance' ) ); ?></div>
    </div>
    Code (markup):
    to it but know that the loop might not be loaded on the search by category page so next and previous won't show up even if you add the code since there is no supporting content to make the post navigation appear.

    To find out the which template page controls the search by category page simply add an
    <h1>Test!</h1>
    Code (markup):
    to the page and refresh the category page until you see the <h1> appear.
     
    ArchAxis, Feb 15, 2013 IP
  10. printex

    printex Greenhorn

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #10
    Thanks Arch, I'll try it :)
     
    printex, Feb 16, 2013 IP