Forums

Navigation styling problem (5 posts)

  1. poliquinp
    Member
    Posted 1 year ago #

    Hi,

    I am trying to set a different effect on my button for "next page" & "previous page" in my navigation when we can't go foward or backward.

    For exemple, I'm on page 1, the "previous button" gonna get [x] styling and if I'm on page 2, the button gonna get [y] styling.

    Can some one tell me how I could reach it?

    Here is my code for the moment.

    <!-- Navigation -->
    		<div class="left">
    			<?php next_posts_link('<img src="images/btn-next-page.gif" />'); ?>
            </div>
            <div class="right">
                <?php previous_posts_link('<img src="images/btn-prev-page.gif" />'); ?>
            </div>
  2. Christine
    Moderator
    Posted 1 year ago #

    I would change the code above to this:

    <div class="post-navigation">
        <div class="left"><?php next_posts_link('&laquo; Older Posts') ?></div>
        <div class="right"><?php previous_posts_link('Newer Posts &raquo;') ?></div>
    </div>

    Then style the buttons in the stylesheet with the appropriate images.
    Please note, that with the above code, the previous link won't show on page 1, because there are no previous posts. I think that's better for usability.

  3. poliquinp
    Member
    Posted 1 year ago #

    Please note, that with the above code, the previous link won't show on page 1, because there are no previous posts. I think that's better for usability.

    this is true, but my designer made a different style button when there is no "Previous" or "Next" page.

    We shoudl start a discussion on the revelance of this kind of thing soon :)

  4. Christine
    Moderator
    Posted 1 year ago #

    I think it's silly to have a button where there shouldn't be any... that's as annoying as going to the restaurant seeing a steak on the menu and finding out that they are all out of steak.

  5. poliquinp
    Member
    Posted 1 year ago #

    This is true.

    But if I come back to the navigation, I used a plugin to be able to get my Previous page & Next page + the Page 1 of X.

    In this plugin I have been able to tweak it a little bit to get my "non-clickable button"...

Topic Closed

This topic has been closed to new replies.

About this Topic