I want this to apply to all posts
First off, making the content
query string defaults to onepage
is actually equivalent to enabling the onepage()
for all URLs/pages.
And for example to enable it by default on single post pages only (for any post types), then you can replace this:
if( empty( $_GET["content"] ) || "onepage" !== $_GET["content"] )
return;
with this:
if( ! is_single() && ( empty( $_GET["content"] ) || "onepage" !== $_GET["content"] ) )
return;
which means the onepage()
would also be applied on pages/URLs where the content=onepage
presents in the query string.
Check the developer docs for other conditional tags like is_singular()
.
Does that answer your question?