How to display pictures from database?

You’ll want to use wp_get_attachment_image_url() or wp_get_attachment_image(). You just pass them the ID of the image in the database and the size you want. wp_get_attachment_image_url() gives you the URL of the image: echo wp_get_attachment_image_url( $attachment_id, ‘large’ ); // http://example.com/wp-content/uploads/2017/01/image-1024×1024.jpg While wp_get_attachment_image() gives you a full image tag: echo wp_get_attachment_image( $attachment_id, ‘large’, false, [ ‘class’ => … Read more

subdirectory index.php is not working

All you should need to do is make sure the appropriate DirectoryIndex is set. For example, at the top of your .htaccess file: DirectoryIndex index.php This instructs mod_dir to try to serve index.php when requesting a directory, eg. /sq/first/. If you are requesting URLs/directories that don’t already contain the trailing slash, as in your example: … Read more

How to send Ajax request from my plugin in admin dashboard?

Here’s a base snippet I use for AJAX submits in WordPress. It does use jQuery, but there’s no reason vanilla won’t work. You could admin_enqueue_scripts() the <script>, and conditionalize it on the proper page with get_current_screen(). add_action( ‘admin_menu’, function(){ add_menu_page( ‘My Plugin’, ‘My Plugin’, ‘manage_options’, ‘my_plugin_slug’, ‘my_plugin_page’, ‘dashicons-cloud’ ); }); function my_plugin_page() { if (isset($_POST[‘my_plugin_ajax_submit’])) … Read more