php – Help to modify wp_link_pages()

Question

My site has the Newspaper theme by tagDiv, which installs two necessary plugins to make things work better. These plugins are Composer and Standard Pack.

I’m trying to modify the default wp_link_pages() but I don’t know how because one of these plugins has code that changes the function.

I don’t want to change the plugin file because it is frequently updated. The problem is that the code is not inside a post file like single.php. And I’m not finding a way to do that.

The plugin code is:

enter image description here

I made this PHP for my own plugin but I don’t know how to make it work. I haven’t found a way to do this with an action or a filter:

function my_new_pagination() {
    if (!is_single) {
            return '';
        }
        return wp_link_pages(array(
        'next_or_number' => 'next',
        'before' => '<div class="new_pag">',
        'after' => '</div>',
        'nextpagelink' => '<span class="testnav">' . __('Next') . ' »</span>',
        'previouspagelink' => '<span class="testnav">« ' . __('Previous') . '</span>',
        'pagelink' => false,
        'echo' => false
    ));
}

Any ideas? Thanks

0
Emmanuel Lima 4 months 2022-01-18T02:02:59-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse