Skip to main content


This topic contains 2 replies, has 0 voices, and was last updated by  Ricky55 5 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #45635


    Hi Guys,

    Hopefully you can help me. I’ve been staring at code all day so I need a break but I just can’t figure how to do this.

    I want a previous posts / next posts link in WordPress in my Single.php but I want to include a little arrow next to the text which I’m using an icon font for rather than an image.

    I don’t think I can just use the standard wordpress next_post_link(‘%link’, ‘Next post’); because I need to add a class name to this link and I also need some span tags for the icon font.

    This being the case I created my own links using a div and the necessary span tags with the data attribute etc,

    [The code I’m using is here]( “My Code Pen”)

    This does work fine, the only problem is when I’m on the most recent post. The text next post disappears as WordPress is controlling this but my span tags still remain. I could use JS to sort this but it just seems like there should be a better way.

    I’m new to WP theming and icon fonts so if anyone can help I’d be very grateful.






    Thanks mate. I think I might I’ve been over complicating this. WordPress does actually provide a rel attribute so I can use that for my CSS hook.


Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

icon-link icon-logo-star icon-search icon-star