0

I would like to add the following to a single page within my wordpress site and NOT all of them.

Current page url/permalink

   mysite.com/pagename/

Would like to

   mysite.com/pagename/?ngg_force_update=1

This is so that the nextgen plugin does not use a cached template, as the one i created for it does random stuff on page loads/refresh etc.

And rather than set the values within the actual plugin and have them over written via an plugin update, the url query is the only why, that i know of, but i don't want to add it to all url's etc just that pages permalink.

1 Answer 1

2

You can filter page_link to modify the output of any page's permalink value. The simplest way to identify the page is by ID, then you can append the query string via add_query_arg:

function wpd_append_query_string( $url, $id ) {
    if( 42 == $id ) {
        $url = add_query_arg( 'ngg_force_update', 1, $url );
    }
    return $url;
}
add_filter( 'page_link', 'wpd_append_query_string', 10, 2 );
1
  • Worked like a charm thanks, sorry for the lateness as well. Commented Dec 9, 2014 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.