Questions tagged [query-string]
The query-string tag has no usage guidance.
115
questions
0
votes
0answers
6 views
REST API: Search products only in the names
I'm using the 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 descriptions.
0
votes
0answers
8 views
Need help with a query string (not normal query) to order posts by one custom field and filter by another
I'm working on a query string (a normal query can't be used in this particular situation) where I need to conditionally display a list of posts, and I'm having trouble saying "order by custom ...
0
votes
1answer
9 views
Translating ACF field value as string with WPML
I have created repeater field with ACF with fields:
Movie name
description
Award (which is Radio button with choices: 1. Award, 2. Award, Grand Prix)
I im displaying this with:
<?php $award = ...
1
vote
1answer
17 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,...
0
votes
0answers
17 views
WP API - Can I use the newly registered rest field as a query parameter?
I've registered some newfield to wordpress pages with the register_rest_field function. THe field shows up fine when I request pages.
However, if I run a query like htts://website.com/wp-json/wp/v2/...
0
votes
0answers
17 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 ...
0
votes
1answer
110 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, ...
0
votes
2answers
289 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 ...
0
votes
1answer
32 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 ...
1
vote
1answer
29 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 ...
2
votes
2answers
159 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/...
0
votes
1answer
97 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 ...
0
votes
1answer
188 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 ...
0
votes
0answers
24 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 ...
0
votes
2answers
94 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 ...
2
votes
1answer
85 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 ...
0
votes
1answer
27 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 ...
1
vote
1answer
234 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' );
...
1
vote
1answer
93 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 ...
0
votes
0answers
269 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', '...
1
vote
3answers
4k 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 ...
1
vote
1answer
297 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?...
0
votes
0answers
238 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 ...
2
votes
3answers
3k 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&...
1
vote
1answer
200 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 ...
5
votes
2answers
2k 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 ...
0
votes
1answer
58 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[...
1
vote
2answers
258 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 ...
1
vote
1answer
517 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 ...
2
votes
1answer
20k views
How to get a query string from a URL with get_query_var?
I am trying to get a custom query string from a URL in WordPress.
I add the following code to functions.php:
function add_query_vars_filter( $vars ){
$vars[] = "token";
return $vars;
}
...
1
vote
1answer
813 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 ...
1
vote
1answer
114 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:
&...
0
votes
0answers
911 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",$...
2
votes
2answers
3k 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¶meter2=dog¶meter3=cat in the url address bar (to make the login page redirect to a ...
2
votes
2answers
156 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', '...
0
votes
1answer
1k 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('...
0
votes
0answers
94 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,...
0
votes
1answer
859 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 ...
0
votes
0answers
146 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
...
0
votes
2answers
955 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&...
0
votes
1answer
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-<?...
1
vote
1answer
3k 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' => $...
0
votes
1answer
1k 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 ...
0
votes
1answer
62 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 ( ...
1
vote
1answer
1k views
Pass query string to page
I wrote this function in my functions.php
function header_resized_img ($path, $width, $height) {
$image = wp_get_image_editor($path);
if (!is_wp_error($image)) {
$image->resize(...
1
vote
0answers
482 views
magnific popup + gravity form query string not passing
I am using magnific popup to display a gravity from in a popup.
the form is on the page using this code:
<div id="form" class="contact-popup mfp-hide">[gravityform id=1]</div>
and my ...
1
vote
1answer
102 views
How to get “string” away - replaced with “nothing” [closed]
I am having - an issue respectively I like to try something:
with this code, I get the title from a product - respectively what is stored in the database, so far:
woocommerce_template_single_title();...
0
votes
1answer
657 views
Htaccess rewrite based on query string, not working [closed]
Google is showing "this site may be hacked", and search results include a few URLs with this kind of pattern of query string:
?lang=ja&k=1309zFKBIXxb6fWDQH0080
Nothing we can find is showing up ...
1
vote
0answers
324 views
How to remove ?wp-mce from page source?
After check GT Metrix I found Remove query strings from static resources results is 50% and then found that's because some URL have ?wp-mce-4103-20162941 and no plugin can remove this so can use a ...
0
votes
1answer
79 views
How do I add a php statement to a jQuery string
I want to insert a php statement into a jQuery String to update the user profile dynamically.
Here is my not working code so far:
jQueryVarWP("#kreis1").append("<option value=\""+array_list[i]+"\"...