omit / remove ” from category list
You can replace ‘<br>’ with ” by setting separator value echo wp_list_categories(array(‘title_li’ => false, ‘style’ => false, ‘separator’ => ”));
You can replace ‘<br>’ with ” by setting separator value echo wp_list_categories(array(‘title_li’ => false, ‘style’ => false, ‘separator’ => ”));
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
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
current_time() supports GMT as the second parameter. See: https://codex.wordpress.org/current_time If no second parameter is passed it should return the timezone set for your site.
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
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
They’re just two different ways of doing the same thing. It’s up to you which one to use, or whether to use both. Neither is ‘correct’. Use whichever makes more sense to you with the structure of your plugin.
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.
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
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