2022 Developer Survey is open! Take survey.

Questions tagged [query-string]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

Taxonomy archive uses incorrect template when query strings are used

I have two taxonomies in use on my site, both of which have their own taxonomy archive templates with different interfaces. I use query strings to perform filtering on each of the archives. My problem ...
user avatar
  • 1
3 votes
0 answers
53 views

Is doing_wp_cron a necessary query string when scheduling cron.php as a cron job?

I have seen various ways to schedule the WordPress cron so that it is triggered by the server. Some will run the php file directory from the crontab and others will use a wget and reference the url. I ...
user avatar
0 votes
0 answers
13 views

Change admin_title of a plugin using code snippet/functions

Been trying to figure out a good method to change the browser tab/window title for a backend admin page for a plugin. I've tried a slew of plugins, including Admin Meu Editor Pro, and for whatever ...
user avatar
0 votes
1 answer
137 views

Query String Link With Anchor Tag Not Working on Same Page

I have created a store/franchise locator page here. Once users click "Contact Franchise" on the locator, the franchise name is passed to the form underneath. The query string looks like this ...
user avatar
0 votes
1 answer
29 views

How to grab query string from wp-content/uploads/.*

I've written a quick little plugin to grab some custom query_vars, do some manipulation, and store the output in a CSV file. It works great for pages and posts, but ... it seems that queries to wp-...
user avatar
0 votes
0 answers
26 views

Query String Filtering API

Currently, I'm working on a search application that searches/filters stores(Custom Post Type) based on the store-feature(Custom Taxamonies) IDs. When I use the WordPress Fetch API, I can get the full ...
user avatar
2 votes
1 answer
197 views

Add custom URLs to WordPress's XML sitemap

My WordPress site also incorporates some external non-WP content that is dynamically pulled into the page via shortcode. The content shown depends on a query string parameter. So from WP's point of ...
user avatar
  • 143
2 votes
1 answer
331 views

Passing array of strings to a SQL statement in a WordPress plugin

I have an issue with passing an array of strings to a SQL statement in a WordPress plugin, because the prepare method adds a backslash before each apostrophe. // I have an array of strings. $the_array ...
user avatar
0 votes
1 answer
28 views

Use “name” query string to refer to form field instead of pagename

I’m trying to auto-populate a form using url parameters (query strings). The problem is when I use the “name” query string (eg mysite.com/?name=xyz), it is referring to the pagename instead of the ...
user avatar
3 votes
0 answers
44 views

Query string becomes encoded when a static page is used as homepage

In the Wordpress Admin 'Reading Settings' under the 'Your home page displays' option, when a static page is selected as Homepage, it appears that any query string with special characters added to the ...
user avatar
  • 31
0 votes
0 answers
243 views

REST API: Search products only in the names

I'm using the WooCommerce REST API to search products by string. Quick question: Is it possible to limit the REST API query ?search= to products names ? Currently it also searches the string in the ...
user avatar
1 vote
1 answer
45 views

Query String being Removed Creating a Pagination Issue within a Custom Plugin

I created simple custom WordPress plugin for a client in 2016 that simply displays a paginated list of results queried from a custom table. try { $recordcountquery = 'SELECT FName,...
user avatar
  • 113
0 votes
0 answers
23 views

Site using static homepage, redirects (301) and removes pluses from query string

It seems as though all WordPress sites that I’m supporting for various clients has this same functionality — if the site is using a static homepage, and you visit the homepage with a query string ...
user avatar
0 votes
1 answer
304 views

dynamic page not displaying correctly when Varnish hosting ignores query string parameters

I have a WP site with managed hosting that uses Varnish. I have a landing page that displays the appropriate images based on a couple arguments passed through the query string. So for example, ...
user avatar
  • 191
0 votes
2 answers
1k views

Custom Rewrite Rule Removing Query String

I'm trying (and failing) to use rewrite rules to redirect shorter/prettier URLs to the right page AND include values in the query string. WP is installed at https://example.com, and the plugin creates ...
user avatar
0 votes
1 answer
168 views

Can a link in WordPress contain a query string that is picked up as $_POST

This question is about a very specific circumstance. The site has one template file that can run a default category query with thumbnail, linked title and excerpt, or it can run a linked title only ...
user avatar
1 vote
1 answer
80 views

Creating a Video Content Page (how to use query strings in wordpress)- Help!

I'm very new to Wordpress, so apologies. I have a project that I'm working on and I'm hoping someone could point me in the right direction. To start off I am volunteering to do some work for a small ...
user avatar
  • 11
2 votes
2 answers
327 views

Add query string to url and display it as normal url part /folder/

I have a query string added to some urls which isn't pretty: ?city=Amsterdam So i'd like to structure the url like: https://example.com/realpage1/realpage2/amsterdam/ or https://example.com/...
user avatar
  • 43
0 votes
1 answer
199 views

Querystring value being stripped from site_url()

This is a question about a plugin. A form to search the database works. What I am trying to do is have the search term reload into the form input field when returning search results. The problem is ...
user avatar
  • 239
0 votes
1 answer
424 views

Adding query string parameters to URL with same name as custom post type gives 404 error

I have a Projects page where I use query strings to deep-link to different categories using JavaScript. For example if my URL is www.mysite.com/projects/?theme=blue then I read this query string in ...
user avatar
  • 268
0 votes
0 answers
28 views

Display plugin-generated content to override a placeholder page

I am building a plugin, but despite several search parameters, I cannot figure out how to replace a page's content with custom content generated by my plugin. I have already written several ...
user avatar
0 votes
2 answers
182 views

How to use query string in URL to display content on the wordpress page

My wordpress page URL is like this https:www.com/thanks-page/?origin_name=Sydney&origin_iata=SYD&destination_name=Ahmedabad&destination_iata=AMD I need to display SYD and AMD in to the ...
user avatar
  • 3
2 votes
1 answer
174 views

How to get "extended" path info from URL in a plugin

Working on a plugin that creates short codes to embed into a page. I have permalinks set to "Post name", so http://example.com/post-name/ I want to be able to pass additional information in the URL ...
user avatar
0 votes
1 answer
63 views

How to echo a string in custom posts args from a custom field?

i am using a function (maav_portfolio_infinite_loading) to load more custom posts on a page via ajax. I want to be able to load only from a specific category that i can set it on the main portfolio ...
user avatar
1 vote
1 answer
325 views

Detect permalinks when passing querystring in REST API requests

Let's say I'm using wp_localize_script to pass base REST url to my script in a Wordpress plugin: wp_register_script( 'my-plugin', plugin_dir_url( __FILE__ ) . '../dist/admin-main.js', [], '0.9.2' ); ...
user avatar
1 vote
1 answer
109 views

Passing & Reading URL Parameters with URL re-writing

I’m fairly new to wordpress and all my previous sites have been in .asp or raw .php. and although I can tinker I’m no developer and due to time constraints I was hoping this would be an easy fix - but ...
user avatar
0 votes
0 answers
446 views

Custom query vars empty

I have added to my child theme functions.php: function mychildtheme_register_query_vars( $vars ) { $vars[] = 'papers'; return $vars; } add_filter( 'query_vars', '...
user avatar
  • 1
1 vote
3 answers
10k views

Replace text string on individual page

I am looking to replace a few text strings for only two specific pages on a wordpress site. It should not affect those strings on any other pages. I'd prefer to do this via adding some code to ...
user avatar
1 vote
1 answer
369 views

How to remove query string from static resource in WordPress?

I have this type of query string, Like: https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js?ba0a5a&ba0a5a https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js?...
user avatar
0 votes
0 answers
253 views

Get value of pre-populated Gravity forms field as variable in my function

I am using a dynamic field in Gravity forms which is pre-populated via a query string from another page. https://www.domain.com/example?country=US I have a function where I would like to get the ...
user avatar
  • 688
2 votes
3 answers
4k views

Concatenate site_url and string doesn't work

I'm trying to concatenate my site_url and a string, but it doesn't work. This is what I'm doing: $myurl = site_url(); var_dump($myurl); $url = "https" . $myurl . "/inbox/?fepaction=viewmessage&...
user avatar
  • 153
1 vote
1 answer
372 views

Keep query string in url after executing a serch

Not sure if I titled it correctly but here is what I'm trying to do. What it's doing: User comes to my website with a campaign query string appended to the url like www.mywebsite.com?name=myName. I ...
user avatar
7 votes
2 answers
3k views

Paginate Link generate additional #038; whenever my Url have multiple Query String

My generated paginate link results will have additional #038; in the url, may I know how to get rid of it? Blog page url : http://localhost/wordpress/blog/ I had already setup pagination with ...
user avatar
  • 175
0 votes
1 answer
65 views

How to Include Fields in Query String When Making Request of WordPress.org Plugin API?

I am running a query against the WordPress.org Plugin API that looks like this went built: https://api.wordpress.org/plugins/info/1.1/?action=query_plugins&request[per_page]=10&request[...
user avatar
1 vote
2 answers
471 views

mod_rewrite empties QUERY_STRING if starting with number [closed]

I have a simple database query script alongside with my WordPress installation, to which I pass a parameter using the following URL: http://example.com/db/?p=foo. My database script reads the ...
user avatar
1 vote
1 answer
740 views

How to build a shortcode which can insert a query string into a DB table

I need to build a landing page from which I can grab a token from a query-string in the URL. I would therefore like to create a shortcode which can achieve this. I have found a plugin which can grab ...
user avatar
3 votes
1 answer
27k views

How to get a URL parameter from a URL with get_query_var?

I am trying to get a custom URL parameter from a URL in WordPress. I add the following code to functions.php: function add_query_vars_filter( $vars ){ $vars[] = "token"; return $vars;...
user avatar
1 vote
1 answer
1k views

Remove query string specific key value

I'm adding multiple values of the same key as a query string with add_query_arg function to filter products. The problem is that i want to remove only the value of the link clicked instead of the ...
user avatar
1 vote
1 answer
178 views

Insert custom PHP head above <html> in WP pages

I've made a WordPress site. Before, I had a coded site in HTML. My new WordPress site is still in maintenance mode. But, I want to insert a PHP code above all the website content. This is my code: &...
user avatar
  • 13
0 votes
0 answers
1k views

problem in using wpdb->prepare and a string placeholder

I have a pb using wpdb->prepare and string placeholders. If I do: $sql = $wpdb->prepare("SELECT * FROM %s AS T1 LEFT JOIN $table_users AS T2 ON T1.id_assure = T2.ID WHERE T1.id = %d",$...
user avatar
  • 59
2 votes
2 answers
5k views

Wp Login redirect strips parameters from url

If i write http://domain.com/wp-login.php?redirect_to=http://domain.com/specificpage/?parameter1=dog&parameter2=dog&parameter3=cat in the url address bar (to make the login page redirect to a ...
user avatar
  • 35
2 votes
2 answers
176 views

Meta box io oembed returns list not array

i have created a meta box oembed with clone: function media( $meta_boxes ) { $prefix = ''; $meta_boxes[] = array( 'id' => 'media_1', 'title' => esc_html__( 'Media', '...
user avatar
0 votes
1 answer
2k views

how to access query string in wordpress?

There are several ways I have seen this question worded, so I tried to make mine generic. Let's say I go to this page: example.com/page/?utm_source=test&s=test&page=12 get_query_var('...
user avatar
  • 151
0 votes
0 answers
126 views

Active state does not work with the query string in the url

I have couple of pages on the website Home and Open Positions. The problem is in the navigation menu, active class is not applied to the page if any query string is supplied to the page. For instance,...
user avatar
0 votes
1 answer
1k views

Query string order by custom field

I have code for custom post type, for custom taxonomy for displaying category posts. I am using Advanced Custom Fields What I want is to order posts by custom field value, and I was wondering how I ...
user avatar
  • 85
0 votes
0 answers
153 views

Multiple wpostmeta.meta_key

i need to add a new condition to this query: $querystr = " SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE post_id IN( SELECT DISTINCT wpostmeta.post_id ...
user avatar
0 votes
2 answers
1k views

Search Query for Multiple Terms In Same Taxonomy

I have a search that works fine with custom fields, and one term per taxonomy. However I want to select multiple terms from one taxonomy "property-type". My current query looks like --- /?s=Search&...
user avatar
  • 176
0 votes
1 answer
1k views

How to return a string that has a jQuery and Ajax inside in a shortcode?

This is the whole code actually → <script> jQuery.noConflict(); jQuery(document).ready(function() { jQuery('#mailchimp_submit-<?...
user avatar
2 votes
1 answer
4k views

Query_posts $query_string

I have a query that looks like: query_posts($query_string."&post_type=attachment&posts_per_page=9&paged=".$paged); I'd like it to looks something like: $args = array( 'paged' => $...
user avatar
  • 1,115
0 votes
1 answer
2k views

Filter results from a serialized string to use on statistics

I need to get the values from a serialized string, to use it on some statistics. I already got that info in other pages to show some content, but I have no idea why I'm having this problem now. The ...
user avatar