Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [query-string]

The tag has no usage guidance.

0
votes
0answers
18 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', '...
0
votes
0answers
11 views

meta filter and taxonomy filter on custom taxonomy template

http://192.168.178.17/property/city/mohali/ city is my taxanomy template i want to add filters in query string for taxonomy, category and meta data how to add filter
0
votes
1answer
22 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
133 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
83 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 ...
1
vote
3answers
159 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
26 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 ...
3
votes
2answers
118 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
45 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
26 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
74 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 ...
0
votes
1answer
1k 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
354 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
38 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
167 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",$...
0
votes
0answers
26 views

.htaccess URLs rewrite

How can I rewrite URLs from: http://www.imperialtranstur.md/mare?lang=ro&cat=bulgaria&tip=mare to http://www.imperialtranstur.md/ro/mare/bulgaria from http://www.imperialtranstur.md/hotele-...
0
votes
1answer
575 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 ...
2
votes
2answers
62 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
152 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
38 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
380 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
117 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
472 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
593 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-<?...
0
votes
1answer
841 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
375 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
50 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
511 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
293 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
61 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
390 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 ...
0
votes
0answers
79 views

Can I clean or remove the 's' parameter?

I'm using the WordPress search widget in my WordPress site and would like to either prevent this from showing in the query string or clean the query string of html when a user manually types into the ...
1
vote
0answers
159 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
62 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]+"\"...
2
votes
1answer
2k views

How can I include a query string with get_permalink

My login link uses wp_login_url( get_permalink() ) so that the user is redirected back to the page they were viewing, and not to the dashboard. However, this does not include query strings. So if a ...
-1
votes
1answer
188 views

How to submit a form automatically

I am using a form plugin, Formcraft. Users get to the form via two URLs, each passing different parameters in the query string. The form is set up with conditional logic so each URL shows different ...
0
votes
1answer
83 views

How would I get Wordpress to parse /mypage/area/value as /mypage/?area=value?

I have sucessfully "registered" a query key called "area" in functions.php like so: function myplugin_register_query_vars( $vars ) { $vars[] = 'area'; return $vars; } add_filter( 'query_vars',...
0
votes
1answer
229 views

adding tax_query to $query_string

I need to adjust the query in the loop.php by adding tax_queries based on $_REQUEST params. i tried something like this $argsExtended = array( 'tax_query' => array( array( ...
1
vote
1answer
38 views

Check if page is embeded

I'm trying to make condition that checks if the page is embeded with iFrame, but all the ways I know won't work. I'm embeding Woocommerce single product page, on custom template where only necessary ...
0
votes
0answers
671 views

query_vars filter not working

class My_Class{ function __construct() { $this->add_query_vars(); } function add_query_vars(){ add_filter( 'query_vars', array( $this, 'add_query_vars_filter' ) ); } /** * ...
1
vote
2answers
994 views

Remove Query String from URL on Redirect - Redirection Plugin

I am trying to remove the query string from my URLs when I redirect them but it is preserving them. I can't get the regex right. Also, I have multiple templates that redirect to different urls so I ...
0
votes
2answers
591 views

Query String for the WP_QUERY parameters

I don't know how to turn some WP QUERY parameters into url query strings. Most of them are straight forward, but there are some I don't know how to get working. For example, for these WP_QUERY ...
0
votes
3answers
100 views

Wordpress function and string as variable?

I am creating something which passes featured image URLs to a separate JavaScript file which uses parallax.js to create a parallax background for each entry for an archive page. This works fine when ...
0
votes
1answer
2k views

PHP $_REQUEST array empty

I have a really odd issue: I have a WP site, staging and live are on the same server. Query string variables aren't registering in the $_GET or $_REQUEST arrays on the live site (but they are on ...
1
vote
2answers
169 views

Count number of published posts by type

I have this code, but it shows the total number of posts published by post type 'code'. <?php $count_posts = wp_count_posts('code')->publish; echo $count_posts; ?> I have 2 post types: '...
3
votes
0answers
52 views

Showing random content / pictures from earlier posts in a sticky post?

I have a sticky post on my wordpress blog, in the beginning. I would like to place some random content in it, by simply replacing some HTML in the post content. The random content would come from ...
0
votes
1answer
241 views

Prevent redirect to page/page when reserved term 'name' in $_POST when value is a page/post title

I'm using a particular payment gateway which includes in their payment response the parameter 'name'. I'm aware this is a reserved term which shouldn't be used. Unfortunately, I have no control over ...
1
vote
1answer
440 views

pass query string on url to filter media

I have an author page which shows all uploaded media by that author. Each media can have tag1, tag2 or tag3. I would like to add an option where I can show on that same page only tag1 media without ...
0
votes
1answer
679 views

WP adds long version query strings to CSS and JS files

I noticed WP adding long query strings to my CSS and JS files. Not just the version parameter from wp_enqueue_style from a Theme or something, no something fishy going on. I even switched to the 2016 ...
1
vote
2answers
665 views

How can I get the [video] shortcode to allow query string parameters?

Using WordPress 4.4.2 (latest version as of writing this) I'm trying to use the [video] shortcode to show a video on my site. If I provide a url ending with the filename.mp4 it works fine: [video ...