Questions tagged [query-string]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
236 views

Allow question marks (?) in WordPress permalinks

I have migrated an older site to WordPress and need to keep all legacy URLs. I am using a plugin called Custom Permalinks for that purpose, which works well, except for one thing: it strips all "...
Dave's user avatar
  • 119
0 votes
1 answer
69 views

query_vars doesn't return query string (trying to get data from $wpdb)

I have a ref query string which matches rows in my wp_invites table. In my wp_invites table, I have the following columns: lead_name reference Let's assume here is one of the rows: Lead name: ...
Freddy's user avatar
  • 147
4 votes
0 answers
610 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 ...
Mark Hunter's user avatar
0 votes
1 answer
1k 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 ...
Esme  June's user avatar
0 votes
1 answer
80 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-...
philolegein's user avatar
2 votes
1 answer
1k 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 ...
equin0x80's user avatar
  • 143
2 votes
1 answer
1k 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 ...
Ramona Morea's user avatar
0 votes
1 answer
114 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 ...
davidvishal's user avatar
3 votes
0 answers
136 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 ...
Sam Zhu's user avatar
  • 31
0 votes
0 answers
427 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 ...
JAGENI Nat's user avatar
1 vote
1 answer
150 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,...
Andrew's user avatar
  • 113
0 votes
0 answers
39 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 ...
kevindeleon's user avatar
0 votes
1 answer
521 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, ...
Daveh0's user avatar
  • 189
0 votes
2 answers
2k 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 ...
appshine's user avatar
0 votes
1 answer
336 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 ...
Nora McDougall-Collins's user avatar
1 vote
1 answer
132 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 ...
Bruno's user avatar
  • 11
2 votes
2 answers
495 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/...
Peps's user avatar
  • 53
0 votes
1 answer
374 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 ...
Steve's user avatar
  • 277
0 votes
1 answer
570 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 ...
Gavin's user avatar
  • 339
0 votes
0 answers
30 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 ...
Prdufresne's user avatar
0 votes
2 answers
407 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 ...
Rakesh's user avatar
  • 3
3 votes
1 answer
281 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 ...
Craig Jacobs's user avatar
0 votes
1 answer
96 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 ...
mThemes Net's user avatar
1 vote
1 answer
568 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' ); ...
Filip Růžička's user avatar
1 vote
1 answer
139 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 ...
Fozzy279's user avatar
0 votes
0 answers
646 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', '...
Det's user avatar
  • 1
1 vote
3 answers
15k 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 ...
user136330's user avatar
1 vote
1 answer
409 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?...
Rakesh Patidar's user avatar
0 votes
0 answers
262 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 ...
JoaMika's user avatar
  • 668
2 votes
3 answers
5k 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&...
nielsv's user avatar
  • 173
1 vote
1 answer
618 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 ...
feedmeimhungry's user avatar
7 votes
2 answers
4k 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 ...
Mavichow's user avatar
  • 189
0 votes
1 answer
66 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[...
davemackey's user avatar
1 vote
2 answers
554 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 ...
nounours's user avatar
1 vote
1 answer
855 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 ...
flemmingha's user avatar
4 votes
1 answer
33k 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;...
flemmingha's 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 ...
Gabriel Souza's user avatar
1 vote
1 answer
328 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: &...
Luuk F.'s user avatar
  • 13
0 votes
1 answer
2k 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",$...
Pierre's user avatar
  • 69
2 votes
2 answers
6k 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 ...
Nori's user avatar
  • 35
2 votes
2 answers
194 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', '...
Phaidonas Gialis's user avatar
0 votes
1 answer
3k 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('...
adam rowe's user avatar
  • 161
0 votes
0 answers
185 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,...
Ghazanfar Mir's 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 ...
David's user avatar
  • 87
0 votes
0 answers
160 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 ...
Caponi Elia's 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&...
730wavy's user avatar
  • 193
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-<?...
WordCent's user avatar
  • 1,827
3 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' => $...
Josh Rodgers's user avatar
  • 1,173
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 ...
Marcelo Henriques Cortez's user avatar
0 votes
1 answer
68 views

How to load this code on function.php

guys, this is my first question here, Thank you so much in advance. I'm trying to integrate a code on every product page But it created some conflict: function print_my_inline_script() { if ( ...
Hicham MARKUS's user avatar