Eliminating "Page: " in pagination

Discussion in 'WordPress' started by Ian, Jun 14, 2014.

  1. #1
    Trying to customize the "Previous" and "Next" page links when I split up single posts with the <!--nextpage--> tag, but I'm wondering how to get rid of the "Page: " prefix that appears in front of those links. Anyone know how to get rid of that?
     
    Ian, Jun 14, 2014 IP
  2. themes4all

    themes4all Well-Known Member

    Messages:
    662
    Likes Received:
    47
    Best Answers:
    6
    Trophy Points:
    100
    #2
    hello,

    it's better to provide a code or a theme you use.. Like that we can give a solution !
     
    themes4all, Jun 14, 2014 IP
  3. Ian

    Ian Well-Known Member

    Messages:
    409
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    125
    #3
    Thanks for the reply. I have the following in the "loop":
    <?php $pagination = wp_link_pages(array('next_or_number'=>'next', 'previouspagelink'=>'&laquo; PREVIOUS ', 'separator' => ' | ', 'nextpagelink'=>' CONTINUE READING &raquo;'));
    
    ?>
    PHP:
    Which outputs: Pages: « PREVIOUS | CONTINUE READING »

    I'm just wondering where the "Pages: " is generated. The theme is a custom one I created a while ago based off of ModXBlog, not sure if that helps or not...
     
    Ian, Jun 14, 2014 IP
  4. TIEro

    TIEro Active Member

    Messages:
    741
    Likes Received:
    177
    Best Answers:
    5
    Trophy Points:
    70
    #4
    The function is defined here: http://codex.wordpress.org/Function_Reference/wp_link_pages

    So you would need to include an additional parameter in the array when you call it, to replace the default: 'before' => '<p>' . __( 'Pages:' )

    Something like 'before' => '<p>' would do it, if you just want to get rid of the "Pages:" bit.

    Hope it helps!
     
    TIEro, Jun 15, 2014 IP
  5. themes4all

    themes4all Well-Known Member

    Messages:
    662
    Likes Received:
    47
    Best Answers:
    6
    Trophy Points:
    100
    #5
    TIEro guided you to the good place.. you are using the default wordpress wp_link_pages, you have to check your theme functions.php file and look for the code : 'before' => '<p>' . __( 'Pages:' ),
    and remove the Pages:

    Otherwise you will have to check the post-template.php. but it's not Recommended to change the Wordpress Core Files.
     
    themes4all, Jun 15, 2014 IP
  6. TIEro

    TIEro Active Member

    Messages:
    741
    Likes Received:
    177
    Best Answers:
    5
    Trophy Points:
    70
    #6
    No need for that. He can just pass the parameter when he calls the function:

    <?php $pagination = wp_link_pages(array('before'=>'<p>','next_or_number'=>'next', 'previouspagelink'=>'&laquo; PREVIOUS ', 'separator' => ' | ', 'nextpagelink'=>' CONTINUE READING &raquo;'));?>
     
    TIEro, Jun 15, 2014 IP
    themes4all likes this.