How to rewrite URL and get the values?

The simplest and quickest solution would be to use the add_rewrite_endpoint function. <?php add_rewrite_endpoint( $name, $places ); ?> So in your case it would be something like this: add_rewrite_endpoint( ‘user’, EP_PERMALINK | EP_PAGES ); An user URL would look like this: http://www.example.com/my-page/user/john To access the variable: $user = get_query_var( ‘user’, false );

I want to filter my products with attributes [closed]

As per what I understood from your question, you want two things – Listing of all publisher Listing of all books of a particular publisher. Here is code for both. Listing of all publisher $terms = get_terms( ‘pa_publisher’ ); echo ‘<ul>’; foreach ($terms as $each_term) { echo ‘<li>’.$each_term->name.'</li>’; } echo ‘</ul>’; Listing of all books … Read more

WP::is_main_query() Not Working

Wrong hook, because what gets passed to wp is the Current WordPress environment instance not The WP_Query instance like it is e.g. passed to loop_start. You could actually just do your check inside the function callback you hook to loop_start. Edit/note: You could just have done global $wp_query; inside the wp hook, it is actually … Read more

Hook for altering the content of all wp mails

Yes, there is a filter for this. The correct filter is wp_mail and is defined in /wp-includes/pluggable.php Line 135 So the code (maybe in your functions.php) should look something like this: function mail_template($args){ ob_start(); require_once (get_template_directory() . ‘/mail-templates/contacemail.php’); $args[‘message’] = ob_get_contents(); ob_end_clean(); return $args; } add_filter(‘wp_mail’, ‘mail_template’);

Issue with wp_handle_upload

In order to change upload size limit two options have to be changed in php.ini configuration file – upload_max_filesize and post_max_size. These options cannot be changed at runtime so you will need to have access to php.ini in order to modify them. Example: upload_max_filesize = 20M post_max_size = 22M

Disallow: /wp-* in robots.txt?

It seems to be a WP default setting, as many Webmasters have gotten this warning and never edited the robots.txt. Removing all the disallows is the easiest solution, but I assume you want some or all of those directories blocked. Google is only concerned about the .js and .css files, so you could in theory … Read more