• Hello
    I want to remove anchor(a href) from previous_post_link() AND previous_post_link() functions.

    I called them in index.php
    to show next & previous pages [where, Number of posts per page = 5]

    my code

    <div id="morePrev">
                                    <?php next_posts_link(); ?>
                                    <?php previous_posts_link(); ?>
                                        </div>

    Problem is <?php next_posts_link(); ?> AND <?php previous_posts_link(); ?> both are comes in link mode(a href).
    I know those functions beside from link-template.php
    But I want to get only text of url,ie
    http://myblog.com/?paged=1

    So I can wrap them in a href with a Javascript onlick Function.

    Please help me

    Thank you
    – Soumya

Viewing 2 replies - 1 through 2 (of 2 total)
  • possibly try to work with:

    get_next_posts_page_link()

    and

    get_previous_posts_page_link()

    resp.
    those functions might not check if you ar on the first or last of the pages (?)

    Thread Starter soumyaunknown@gmail.com

    (@soumyaunknowngmailcom)

    thanks thats works as u mentioned, it cant recognize 1st & last page.

    Btw I use this get_next_posts_link()
    it Solved my problem

    thank you 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to remove anchor from next_post_link & previous_post_link’ is closed to new replies.