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?
Related Posts:
- What’s the difference between home_url() and site_url()
- Trying to use add_action and do_action with parameters
- Prevent “main” WPMU site_url() being returned in functions
- Custom page with variables in url. Nice url with add_rewrite_rule
- Is it possible to use a forgot password url filter?
- Create Custom URL structure for specific Post category
- How can I rename the WordPress AJAX URL? [duplicate]
- How do I pass arguments for multiple functions hooked to a single action?
- Ninja form Redirect depending on text field content [closed]
- wp-comment author- url +, email filter hook
- Removing custom meta data
- WordPress on AWS Auto scaling and ELB giving 503
- WordPress converts media extention URL automatically to video player
- meta tags doesnt fetch data from permalinks
- How to return hook data when multiple parameters are present?
- Get arguments from URL
- Add unique id to Preview URL
- How can I set the SRC URL of the custom logo image?
- Need to convert image url to a Base_64 data url with wordpress function..
- Protect get_query_var from manual input in url
- Problem with images URL after filter applying
- How i can get the URL?
- include w_thumbnail_src in function?
- Create Custom URL structure for specific Post category using Post ID instead of post name
- Warning at top of website & top menu gone
- Fetch URL parameter
- how can I change all wordpress media file url to custom cdn url?
- Custom route and extract data from slashes and parameter
- reWrite wp-content url to point on my cdn
- How to Override Page Template if URL matches query?
- Add #primary at the end of navlink permalinks on single posts
- Using Switch Statement to Change Image According to Last Digit of Topic ID
- Instead of using $post, how do i get the thumbnail image of the $post
- How to add a meta information to the URL?
- wp_upload_bits – define (sub)folder / (sub)directory before filename?
- How do I change the URL returned by next_posts_link()?
- Function in functions.php by url
- What are the parameters are used in add_action and filters?
- When should you, and when should you not, use wp_list_pluck()?
- Difference between the_permalink() and get_permalink() function
- How to show product SKU on product page
- Gettext details
- Calling a function from functions.php in header [closed]
- Different functions file for each site in multisite installation?
- jQuery plugin function is not a function
- I changed “Howdy” in the admin bar in the dashboard, but when I’m viewing the site it still says Howdy!
- Custom logo sizes for multiple logos
- how to change link of some wordpress pages
- Loop (iterate) through Multi-Site sub-sites (blogs)?
- Proper way of using functions in action hook?
- Custom function for specific user role
- Add custom image size not working
- When to use an if statement after get_posts?
- Programmatically Create Category and sub Category
- Not sure if enqueuing js scripts properly
- Shortcode inserts paragraphs before and after executing shortcode
- Get_template_part inside a folder
- Passing values from a widget to a function within a plugin
- media resize/crop possibilities?
- adding custom script to functions file
- Hook into a function without a hook?
- add_action template_redirect not working for home page
- Way to store featured image width and height in two separate variables?
- Insert template-part inside the content
- Numbering lines of code with the tag?
- Latest Foursquare Checkin function
- How to use parent theme functions in child theme functions.php file?
- How to change a specific admin label
- How to add extra value to permalink
- Bulk updating a group of WordPress Pages every 10 minutes
- remove_filter function to unhook twentysixteen parent theme function
- Function for Sticky Post on Categories causes issues with 404 behavior
- Get value of pre-populated Gravity forms field as variable in my function
- Need to Echo A Url path to show on a wordpress page
- Changing the color of post title [closed]
- Create html from function
- wp_list_pages change of children and anchor of parent
- Admin Panel errors because of functions.php
- WordPress not performing direct update
- Using Output from one Function and calling it into another
- How to add a class and title attribute to the link generated by next/previous post
- “Headers already sent” while trying to add a CSS file to my login page?
- Notice: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ in ….functions.php on line 73
- WordPress Custom wp mail template return full template
- Comment turned Invisible
- How do i set global variable in a function in wordpress functions.php
- Working function() doesn’t execute when triggered by WP CRON
- WordPress – Notice: Function wp_enqueue_script was called incorrectly
- Is it possible to use a post name in a custom post slug?
- How to add more than one menu for logged in members?
- post_row_actions filter from parent theme not executing in child theme
- How to get variable from other function inside class function using add_action for Ajax call
- BuddyPress Edit activity function good practice
- wp_login_form display no styled form
- Would it be possible to disable embeds for specific user roles? If so, how?
- I am looking for a function to create category links in the wordpress loop for articles
- Apply function only for specific post
- Second featured image only shows in metabox preview after saving a post in the wordpress editor
- i recently bought a theme and when i try to activate it says (It appears wp_remote_get() function is disabled in your server. )
- No src and sizes attributes present on WordPress thumbnail images; the smallest image size is loaded irregardless of viewport size