• karlicus

    (@karlicus)


    In WordPress, I have created a custom post type. For navigation I created a left and a right arrow with pure CSS, .arrow_left and .arrow_right.

    My CSS:

    .arrow_left {
      position:absolute;
      left:10px;
      top:5px;
      width: 0;
      height: 0;
      border-top: 10px solid transparent;
      border-bottom: 10px solid transparent;
      border-right:10px solid lightgrey;
    }
    
    .arrow_right {
      position:absolute;
      right:10px;
      top:5px;
      width: 0;
      height: 0;
      border-top: 10px solid transparent;
      border-bottom: 10px solid transparent;
      border-left:10px solid lightgrey;
    }

    Now I would like to attach the navigation functionality to these CSS arrows. I tried out the following:

    <?php previous_post_link('%link','<div class="arrow_left"></div>'); ?>
    <?php next_post_link('%link','<div class="arrow_right"></div>'); ?>

    My problem: When applying this code, both arrows disappear. What’s wrong about the code?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Using post navigation with CSS classes instead images’ is closed to new replies.