WordPress is removing all unknown (not registered) $_GET
parameters while processing the request (same is true for $_POST
).
You can either register the custom variable, or just go the canonical PHP way by using filter_input()
. This will access the original, unchanged GET
parameters.
If you are using filter_input()
, you have to hook into pre_get_posts
to change the fetched resource.
You can also filter query_vars
and register your custom variable here. This will make sure it is preserved.
add_filter( 'query_vars', function ( $vars ) {
$vars[] = 'sereno';
return $vars;
});
Then you can access it per get_query_var( 'sereno' )
now. You still have to change the request somehow if you want to show some custom content.
Related Posts:
- Convert a complex webpage into WP theme
- Posts vs. Pages
- Why aren’t my posts/pages showing up in my WordPress Theme?
- How to create a page that shows the last 10 posts?
- Page of posts made to look like homepage
- Edit post & page option does not display on latest wordpress
- Posts in Page – How to customize the URL?
- Automatically delete default posts and pages on theme install?
- Blog posts are not appearing as subs of Blog Page
- Edit Page button is gone
- When changing pages to posts, how do you set up 301 redirects for the page URLs?
- Display Posts on Custom Page
- Shortcodes on my website stops working after theme update [closed]
- User Selectable Delete of Pages
- 2 dynamic sidebars registered, not showing up
- Multiple Loops Breaking Pages
- How do I Redirect a WordPress Page?
- “about us”, ” contact” sections should be article(post) or page in the simple small Business website?
- How to get ID of the page included with get_page()?
- Posts vs Pages and categories
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- How to dynamically parse and transform post/page content before displaying it?
- Block editors annoying warnings
- How to make default “Privacy Policy Page” a normal page?
- WordPress website loads more posts than expected
- disable Tab post on nav-menus page (Admin)
- Proper way of establishing custom landing pages in WordPress
- is_page Funtion for Posts ?
- is_page() and is_page_template() not being differentiated
- Admin – no Featured image choice in create new/page|post
- How to detect when admin user is on the All Posts page?
- static landing page leading to author specific pages w/ “live” content
- Total number of posts in query (category/tag/author/search results/main page…)
- Custom Permalink Structure for Pages & Posts
- Getting a “404 Not Found” error when “Preview Changes” is clicked
- Why won’t pagination work?
- WordPress Query Posts From Category Post on Static Page
- How to create a “latest news” page showing a list of posts from blog category
- How to identify and hide/remove an element from a WordPress page [closed]
- How to change the layout of posts when viewing all posts by tag [closed]
- How do you search for a post or page with a certain url on the WordPress admin panel?
- How to add some html formated text to every new post in WordPress
- Intercept page request and add value to it
- WordPress 302 Redirect to Random Product/Post/Page
- Images showing up in Post Editor, but not in Published Post
- Output Post with ACF Fields into other Post
- New Posts and Pages Won’t Save
- My Custom Post Type Still Using index.php
- get_children returns older images
- Custom Articles page only showing a limited number of posts per page
- Getting Whitescreen when publishing a post [closed]
- Posts and Pages: 404 Page not found
- the_content() Not Grabbing All Content
- Display Featured Posts Grid on Static Page (Gazette)
- Render a Post or Page using the correct file
- Detecting current page from class method
- Having pages after specifying post_type post
- Unabled to Change Permalinks – Even Using the “Edit” (Resets to Original Permalink on “Update”)
- List all posts, pages and custom post types in admin
- Make ‘blog’ page show content as well as posts underneath it
- I don’t want the complete article to show on homepage
- How do I link a Post Type to a Template in Masterplan?
- Post/page title to permalink transformation – what is behind the scenes?
- Change Author Name to Sitename on Frontend
- Would a “hub” page work better as a page or a post?
- Display on page every post in blog WITH comments
- Are post, page and category IDs unique to each other?
- Change the background of each post according to the category
- Post-Archive like a page in a specific subdirectory
- Showing recent post of category in page
- HTML Inside of Shortcode Breaks Shortcode Output
- Custom Post Type, post-formats associated to custom post type > 404 archives
- Setting limit to posts or page creation
- How do I allow certain users to make a certain type of post?
- Create a frontpage.php and static page template
- Using Posts Like a Page
- Pagination for normal (standard) posts on a page with a custom loop?
- Changing wp_link_pages() to “Next Page” and “Previous Page” buttons?
- posts going to 2 pages/categories only show up in 1
- Have posts included on a page that share same category
- Preview page/post revisions without overwriting current content
- Link from Post to Another Post Via Clicking on Words within Original Post
- add_rewrite_rule and template redirect not working
- post/page content
- Link to older links
- How to link post titles on page A to its posts on page B?
- WordPress Architecture as a CMS – Posts & Pages
- Is it to possible to insert a page in the post depending on the category ofthe post
- Organization of time insensitive content
- Direct some posts to only appear on a specific page
- Adding if statement into the_content()
- How can I add a page that shows posts from a single category?
- How to show next/prev link, when it’s not active?
- Archieve page, Advertisement Every 3 Posts
- Prevent 404 of Author pages without posts
- Prevent duplicate pages from being added
- Different post views for different category views
- What would causes search to return incorrect results?
- Cannot publish posts, but can create new pages
- Making a new post visible on a specific page