Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [query-string]

The tag has no usage guidance.

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

How can I do a search by title and content in separate fields

this is my query, It works well. $args = array( 'post_type' => 'post', 'post_status' => 'publish', 'cat'=> $category, 'date_query' => ...
0
votes
0answers
19 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
35 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
38 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
17 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 ...
0
votes
0answers
21 views

How do I pass a Gravity Forms image field from one form to another using query string?

I am trying to pass an image field, which outputs a URL, to a single text field in another form. I have the query string set up, but passing the image makes the page 404. Thank you ahead of time!
0
votes
1answer
18 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' ); ...
0
votes
1answer
56 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
55 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
1answer
671 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
226 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
218 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
1k 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
68 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 ...
4
votes
2answers
496 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
53 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
28 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
186 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
6k 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
477 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
54 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
345 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",$...
1
vote
2answers
1k 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
122 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
362 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
61 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
599 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
137 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
635 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
811 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
2k 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
793 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
57 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
740 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
396 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
80 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
496 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
224 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
72 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]+"\"...
3
votes
1answer
3k 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
303 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
157 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
355 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
40 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 ...
1
vote
2answers
1k 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
841 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
148 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 ...
2
votes
2answers
509 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
53 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 ...