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?
- Can’t get post ID in functions.php?
- Refresh page after form action
- How to customize search result page title?
- Create new user without password
- Stripping shortcode from custom excerpt function
- Display the number of user comments
- Custom function for user register in wp?
- How to add background image control to page admin controls?
- Call function without having to wait on response
- Retrieve post modified date for specific post by post ID
- add a function to submit options.php
- wp_is_mobile dequeue not working
- Creating a child theme – functions.php code issue
- Only let plugin add actions to wp_head & wp_footer on single posts
- Setting Up Scheduled Tasks (For Scripts to Run)
- problem with has_post_thumpnail in foreach loop
- Find resources dynamically loading and change or add to the url
- Using shortcode content with nested shortcode
- Function wont fire after custom post type is updated
- how can I edit flexslider in woocommerce. [Urgent]
- Conditional Gravity Forms filter in WordPress Multisite
- When a user logs in, how can they view the website instead of the admin menu?
- Do we have to use ftp to recover from a bad functions.php edit?
- current_time(‘timestamp’) seems to be different from the real current time
- How to get_template_directory() properly on local environment
- Missing argument for the function
- custom functions in function file delete automatically daily
- Init action and refresh page after form action
- Replace plugin function with a custom function?
- Delay a function, any function!
- Combine two active_callbacks into one on theme customizer
- How to create shortcode with html and php content?
- Fill empty custom field with other custom field
- Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?
- How do I find the code executed when wp_head() is called?
- Problems with functions.php! Error! [closed]
- Include widget file in functions.php of child theme
- Need help making a short code work
- WordPress functions.php conditional include another functions file
- How to reference different css (bootstrap) stylesheets for the header and body of a page?
- sort title descending with title with number
- Author social media aren’t shown on the page
- Is there anyway to force is_singular() to be true when not loading template?
- How Can I Display the Last Modified Date for User Profiles on WordPress?
- Appending „read more” to the excerpt conditionally
- Why is the term of my current page not returning a slug?
- Serving cache from multiple domain names
- Fatal error: Call to undefined function. Underscore me
- Why am I losing image quality on my site?
- How to run a function when publish posts? [duplicate]
- What is wrong with functions.php? Fills error log with same error
- Function returning queried meta value based on current post ID
- How to add a piece of code in function
- Automatically delete posts based on query
- Dynamically adding Captions to images
- Run function from parent on child site
- Search Woocommerce product titles only
- Post variables not displaying correctly in custom function
- How can I customize the size of the header of my theme?
- Removing all Category pages with one exception
- Add a second stock display [closed]
- How to fix enqueue_styles error for a twenty-seventeen childtheme