Possible htaccess configuration issue for HTTPS websites by WP Fastest Cache plugin? [closed]

Do these lines mean HTTPS urls will not be cached? Well, it certainly means that on most servers that have an SSL cert installed, the URL will not be rewritten to /wp-content/cache/all/<requested-URL-path>/index.html. If that means the cache will be bypassed, then yes, it prevents caching. The idea of not caching HTTPS requests would seem to … Read more

Issue with adding count to “subsubsub” aka quick links on custom_post_type

Use pre_get_posts filter & use is_main_query() function to check for the context (as you’ve figured out in the conversation with @Milo), however, don’t use is_main_query() directly. When you use is_main_query() to check the context, it always checks against the main global $wp_query, instead of another custom query object you may want. So it may cause … Read more

wp_redirect() not working in Insert PHP plugin in WordPress

I have used WordPress’ custom POST handler functionality before to solve a problem similar to the issue that you are having. Here is documentation from the codex on this: https://codex.wordpress.org/Plugin_API/Action_Reference/admin_post_(action) Basically, you would use an action to handle the post request: function my_handle_form_submit() { // This is where you will control your form after it … Read more

Plugin. Html code in Template

One way to do that is to define a function, which either echos or returns stuff, in your plugin file and then use that function in your theme files when needed. For example in your my-awesome-plugin.php function hello_world() { echo ‘Hello world!’; } And then in your theme file, let’s say single.php // safety check … Read more

How to get current post user id

To show author avatar per post inside loop you need to modify a little: $current_post_author_id = get_the_author_meta( ‘ID’ ); <?php if (!empty(get_user_meta($current_post_author_id, ‘user_avatar’, true))): ?> <img src=”https://wordpress.stackexchange.com/questions/317789/<?php echo get_user_meta($current_post_author_id,”user_avatar’, true); ?>” alt=”some text”> Try, if it works for you.

Custom REST API endpoint returns rest_no_route when called via wp-json permalink

The problem is with the bbe_sortables&replace in the permalink: <My URL>/wp-json/bridge/v1/test-data/process/bbe_sortables&replace&_wpnonce=<thenonce> which results in an invalid route, where the supposedly query string is seen as part of the route: /bridge/v1/test-data/process/bbe_sortables&replace&_wpnonce=<thenonce> (the valid route for that URL is /bridge/v1/test-data/process/bbe_sortables) and eventually the REST API throws the rest_no_route error. To fix the problem, use add_query_arg() when generating … Read more

How to check if you are on widget.php page?

You may use the global variable $pagenow to figure out if you are on a particular admin page, in your case this would be checking if you are on the widgets.php admin page: <?php global $pagenow; if( $pagenow === ‘widgets.php’ ) { ?> <script> // JavaScript goes here </script> <?php }   Furthermore, it will … Read more