pass query string on url to filter media

As per the given url http….url…/author/name?MediaTag=tag1, below code may helpful… if(isset($_GET[‘MediaTag’])) //It will check the value of MediaTag (from address bar after ?) { $tag1 = $_GET[‘MediaTag’]; //Assigning value of MediaTag to the variable if($tag1) //Checking if variable have some value or not { query_posts(‘cat=1&author=” . $post->post_author . “&order=DESC&tag=’ . $tag1 .’&posts_per_page=12′ . ‘&paged=’ . … Read more

How to get “string” away – replaced with “nothing” [closed]

The woocommerce_template_single_title() function calls to a template that uses this code: the_title( ‘<h1 class=”product_title entry-title”>’, ‘</h1>’ ); So it is just the product title, there is nothing that could go wrong here. Check if you did not mess up output buffer, try using the_title function from above instead of ob and see if that makes … Read more

Keep query string in url after executing a serch

It’s hard to say how to do it exactly in your case, because we don’t know how your form is generated… But in general you have to add a hidden input to that form. So if you use searchform.php in your theme, then add something like this to it: <input type=”hidden” name=”name” value=”<?php echo esc_attr( … Read more

Replace text string on individual page

I can’t comment so I’ll answer and slightly adjust Bhagyashree’s which is exactly what you’ll need to do based on your question. Except you may want to know how to include the 2 pages rather than duplicating the function. And also passing in an array of strings to replace. function replace_some_text( $content ) { // … Read more

Detect permalinks when passing querystring in REST API requests

In more recent browsers (everything but IE, essentially), there are some useful APIs for working with URLs that will make this easier: let url = new URL( MY_PLUGIN_WP_REST_API_CONFIG.baseUrl ); url.searchParams.append( ‘per_page’, 100 ); url.searchParams.append( ‘order’, ‘asc’ ); fetch( url.toString() ).then(); With those methods the per_page and order parameters will be added correctly regardless of whether … Read more