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?
- Is there a way to batch-find unlinked text URLs in the body text of all my posts and link them?
- Missing feature image link function
- Remove “Category:”, “Tag:”, “Author:” from the_archive_title
- get_template_directory_uri pointing to parent theme not child theme
- How to customize the_archive_title()?
- remove empty paragraphs from the_content?
- What is the “with_front” rewrite key?
- Why use if function_exists?
- How to override parent functions in child themes?
- wp_enqueue_script was called incorrectly
- Add multiple custom fields to the general settings page
- Ajax call always returns 0
- Why “?v=hash” is added to my URLs? [closed]
- 400 bad request on admin-ajax.php only using wp_enqueue_scripts action hook
- How long does a deprecated function live in core?
- Solution to render Shortcodes in Admin Editor
- How to add a data attribute to a WordPress menu item
- What’s the difference between esc_html, esc_attr, esc_html_e, and so on?
- remove_action on after_setup_theme not working from child theme
- plugins_url vs plugin_dir_url
- Remove type attribute from script and style tags added by WordPress
- How to run a function every 5 minutes?
- Best way of passing PHP variable between partials?
- Upload Multiple Files With media_handle_upload
- How to display custom field in woocommerce orders in admin panel?
- Adding fields to the “Add New User” screen in the dashboard
- Issues with title-tag and document_title_parts
- How do I get the current edit page ID in the admin?
- How to check if a user exists by a given id
- Why isn’t is_page working when I put it in the functions.php file?
- Add tags to the section via functions.php
- Add image size if page template
- How to create a custom order status in woocommerce!
- Remove Actions/Filters added via Anonymous Functions
- Adding a second email address to a completed order in WooCommerce [closed]
- How to load parent_theme functions.php before child_theme?
- How to load scripts/styles specific for a page
- Programatically add options to “add new” custom field dropdown
- Is there any global functions.php file which works for any theme?
- Excluding iPad from wp_is_mobile
- When should you, and when should you not, use wp_list_pluck()?
- Get the ID of the page a menu item links to?
- Add container to nav_menu sub menu
- Difference between the_permalink() and get_permalink() function
- What’s the difference between WordPress random_int() and PHP built-in function random_int()?
- Child theme – Overriding ‘require_once’ in functions.php
- Link to user’s profile settings page?
- WordPress Enqueue for homepage only, functions.php, wp-framework
- get php variable from functions php and echo it in theme template files [closed]
- Get menu object from theme_location
- Is it ok to use a function to output the text domain name in a wordpress theme
- Displaying the number of updates available in the Admin area
- use query string in URL to display content on the page
- Use AJAX in shortcode
- Set JPEG compression for specific custom image sizes
- Can the new 4.8v text widget visual editor be removed?
- Include files in child theme functions file
- Memorizing syntax
- Define page template in wp_insert_post
- Which WP functions do you need to use esc_html() or esc_url() on?
- Check if post is being published for the first time, or is an already published post being updated
- Display random categories on the front page (Finding and Editing Theme Functions)