Adding caption to all images inside an article

I’m not 100% sure if I understand your question 100%, but WordPress, by default, displays the caption if it’s filled on the image. Then it displays it just below the image once the image is inserted. Here is an example where I just filled it out on one image 👇

Blocking spambots from Search form

You need to modify the code that processes the search to sense and block invalid attempts. You could do this by looking for a valid session number, or even a session variable that is created by the page that contains the search form. You might also try a hidden field for the search form, although … Read more

Bypass a WordPress Password Protected Page via url

In case somebody needs help about my topic, I’ve fixed the notice error by modifying the original code as following: // BYPASS PASSWORD PRETECTED PAGE URL add_filter( ‘post_password_required’, function( $returned, $post ) { if ( !is_admin() ) { if (strpos($_SERVER[‘REQUEST_URI’], ‘pwd’) !== false){ if( $returned && ( $_GET[‘pwd’] == $post->post_password ) ) $returned = false; … Read more

Hook function when taxonomy terms change

You can avoid infinite loop by removing the action before calling update post function. function maybe_disable_comment($post_id) { // do you check if the post has specific custom tax term. if ( ! has_term( ‘bar’, ‘YOUR_CUSTOM_TAX’, $post_id ) ) { return false; } // remove the filter that will create infinite loop. remove_action( ‘wp_insert_post’, ‘maybe_disable_comment’ ); … Read more

I had removed my phone number from my website footer, but months later it still appears once I look it up on google, how to remove it?

It usually takes several days (or more) for search results to be updated. First step would be to look at every single page of your site and check for the correct phone number. Then create a new sitemap.xml file, and submit that to the various search engines (like via Google Webmaster Tools). Many articles available … Read more

I want to allow certain file types on dokan upload files

You can try allowing mimes yourself, like this : add_filter(‘upload_mimes’, ‘custom_upload_mimes’); function custom_upload_mimes($existing_mimes) { $existing_mimes[‘rbxlx’] = ‘text/xml’; $existing_mimes[‘rbxlm’] = ‘text/xml’; $existing_mimes[‘rbxl’] = ‘text/xml’; return $existing_mimes; } If this doesn’t help, you need to look outside WP – it’s possible the server itself won’t allow those uploads. Can you access the .htaccess ? If so, you … Read more

register_nav_menus() not registering

Perhaps it’s happening too early and getting stomped on later. Try doing it the traditional way, in an init hook callback, like so: function register_my_menu() { register_nav_menus([ ‘main-menu’ => esc_html__(‘Main Menu’, ‘myfirsttheme’), ]); } add_action( ‘init’, ‘register_my_menu’ );