Articles of query string

Accessing custom URL parameters

I have created a page in wordpress to accept query string parameters. For the wordpress to recognize the query string parameters, URL parameter is added to query_vars using the following code snippet in Theme functions (functions.php) file. Below is the code snippet I have added to recognize the URL parameter ‘website’: function add_query_vars( $aVars ) […]

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 theme to be sure and even there: localhost/wp-content/themes/twentysixteen/genericons/genericons.css?ver=26a451f6ce396fe8c8b0ae0cf1b05446 localhost/wp-content/themes/twentysixteen/style.css?ver=26a451f6ce396fe8c8b0ae0cf1b05446 What is this and where does it come from? I […]

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 each post has an image. I have been working on having a default image where there is no featured image but am […]

Htaccess rewrite based on query string, not working

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 any hack. We’d like to return a 404 for any URLs containing “lang=ja” (at least for now while we look into it further), so […]

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 ( wp_script_is( ‘some-script-handle’, ‘done’ ) ) { ?> <script type=”text/javascript”> <div id=”BVRRContainer”></div> <script type=”text/javascript”> $BV.ui( ‘rr’, ‘show_reviews’, { doShowContent : function () { […]

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’, ‘myplugin_register_query_vars’ ); This allows me to have a page with a key/value pair like: Note that in this example, “mypage” is the slug for an existing WordPress Page. […]

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 DB has a table called wj_db7_forms (I’m using a WordPress plugin to log the inputs […]

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-<?php echo $random?>’).click(function() { jQuery(‘#process-<?php echo $random?>’).css(‘display’,’block’); var datastring = ‘&name=’ + escape(jQuery(‘#name-<?php echo $random?>’).val()) + ‘&email=’ + escape(jQuery(‘#email-<?php echo $random?>’).val()) + ‘&api_key=<?php echo $mailchimp_api_key;?>&list_id=<?php echo $mailchimp_list_id;?>’; jQuery.ajax({ url: ‘<?php echo rest_url(‘/chimp/rest/process_chimp/’);?>’, data: datastring, success: function(msg) { jQuery(‘#process-<?php echo $random?>’).css(‘display’,’none’); jQuery(‘#newsletter_msg-<?php echo $random?>’).html(msg); }, […]

when the incoming url is a query, in which function does WP begin to work with it?

I need to debug a problem with filters I have in place. they’re affecting any url that includes a query; eg, does anyone know in which function WP begins to work with this kind of url, one that includes a query? cheers, Gregory

How to translate “$before” with get text in get_the_term_list?

How can I make $before (Books:) a translateable string <?php echo get_the_term_list( $post->ID, ‘book’, ‘Books: ‘,’, ‘, ‘ ‘, ” ); ?> with this method?: <?php the_content(__(‘Read more…’, “ft”)); ?>