1. What is WordPress?
WordPress is the most popular open-source content management system (CMS) in the world.


2. What is the latest version of WordPress?
6.X.X is the latest version of WordPress


3. What are the minimum requirements of WordPress?
To run the wordpress application, we need a host that supports –

PHP version 7.4 or greater

MySQL version 5.7 or greater or MariaDB version 10.3 or greater


4. What are the advantages of WordPress?
Advantages of WordPress:

  • WordPress is free and open-source
  • Easy to install and use, even a non-technical person can use it.
  • Lots of free themes and plugins are available in the WordPress directory.
  • Simple CMS admin panel interface
  • Flexible can be customized easily and quickly

5. What is post type?
The Post Type is a term used to represent the different types of content (e.g., posts, news, products) in WordPress.


6. Difference between post and page
Generally, posts are sorted by tags and categories but pages are organized by users.

Posts are used for frequently updated content whereas pages are used for static content.


7. How to create a custom post-type?
We can create a custom post-type using the register_post_type() function and init action hook.


8. What is taxonomy?
Taxonomies are the classification methods used to group posts or custom post types in WordPress.


9. Difference between categories and tags
Categories are hierarchical taxonomies whereas tags are non-hierarchical.


10. How to create a custom taxonomy?
We can create a custom taxonomy by using the register_taxonomy() function and init action hook.


11. What is a custom field?
Custom fields add extra information to posts, pages, and custom post types.


12. What is metadata?
Metadata is data about data. It is a key-value pair where the key is the metadata name and the value is the extra information assigned to the key.


13. How to display a custom field?
The get_post_meta() function is used to retrieve and display a custom field.

<?php echo get_post_meta( get_the_ID(), ‘custom_field_name’, true ); ?>


14. What are template tags?
The WordPress template tags are predefined PHP functions that fetch and display information dynamically.


15. What are template files?
Template files are the building blocks of a WordPress theme. They are responsible for displaying the content and structure on a WordPress site.


16. How to register a navigation menu?
The function register_nav_menus() creates multiple navigation menus at once.

function register_navigation_menus()     register_nav_menus( array(        ‘main-menu’ => ‘Main Navigation Menu’,        ‘footer-menu’ => ‘Footer Navigation Menu’,    ));}add_action(‘after_setup_theme’, ‘register_navigation_menus’);{


17. How to display a navigation menu?
The function wp_nav_menu() is used to display a navigation menu in WordPress.

<?phpwp_nav_menu( array(    ‘theme_location’ => ‘main-menu’) );?>


18. What are the required files for WordPress themes?
Style.css and index.php are the required files for a WordPress theme.


19. What is the required header field for style.css in a WordPress theme?
The required header field for style.css is the Theme Name.

Example:

/*Theme Name: My Custom Theme */


20. Advantages of a child theme?
Advantages of the child theme:

  • Keep customization separate from a parent theme
  • Allow you to upgrade the parent theme without losing your customizations
  • Speed up WordPress development time

21. What is the required file for a WordPress child theme?
The style.css is the only required file for a WordPress child theme.


22. What are the required header fields for style.css in a WordPress child theme?
The required header fields are Theme Name and Template.

Example:

/*Theme Name: My Child ThemeTemplate: twentytwentythree*/


23. How to add scripts and styles in WordPress?
The function wp_enqueue_style() is used to add a stylesheet file in a WordPress theme or plugin.

Similarly, wp_enqueue_script() function helps us to add JavaScript files.

function enque_styles_and_scripts         wp_enqueue_style( ‘style-name’, get_stylesheet_uri() );        wp_enqueue_script( ‘script-name’, get_template_directory_uri() . ‘/js/custom.js’, array(), ‘1.0’, true );}add_action( ‘wp_enqueue_scripts’, ‘enque_styles_and_scripts’ );{


24. How many types of user roles are there in WordPress?
In WordPress, there are five predefined user roles:

  1. Subscriber
  2. Contributor
  3. Author
  4. Editor
  5. Administrator

25. What is WP_Query?
WP_Query is a PHP class defined in WordPress that allows developers to write custom queries and display posts using different parameters.


26. How to enable WordPress to debug mode?
To enable WordPress debug mode, open your website’s wp-config.php file in the root directory. Now, look for the following line:

define(‘WP_DEBUG’, false);

Change it to:

define(‘WP_DEBUG’, true);


27. How to optimize a WordPress site?
Best ways to optimize your  WordPress site:

  1. Optimize media files
  2. Use a good hosting and domain server
  3. Apply caching method
  4. Minimize scripts and styles
  5. Use the lazy loading method
  6. Deactivate unused plugins
  7. Use a fast CDN
  8. Reduce external HTTP request
  9. Update WordPress core files, plugins, and themes
  10. Optimize the database

28. What are hooks?
Wordpress hooks are one piece of code used to interact with another piece of code. It can modify the default behavior of wordpress without touching the core wordpress files.


29. How many types of hooks are there in WordPress?
There are two types of hooks in WordPress, namely action hook and filter hook.


30. What is an action hook?
The action hooks are used to modify the default behavior of a specific wordpress function. It doesn’t return any data to wordpress after completing the task.


31. What is a filter hook?
The filter hooks are used to modify the default behavior of a specific wordpress function. After completing the task, it returns some data to wordpress.


32. What are plugins?
A plugin is a piece of software that provides additional features to your WordPress site.


33. How to create a plugin?
To create a new plugin, follow the steps below.

Step 1: Navigate to the wp-content directory that resides in the root directory of your wordpress installation.

Step 2: Open the plugin directory.

Step 3: Make a new directory called my-custom-plugin.

Step 4: Create a new PHP file called my-custom-plugin.php(it is good to name this file after your plugin). Add the following codes to your newly created PHP file:

/*Plugin Name: My Custom Plugin*/function my_custom_excerpt_length($length){        // By default, the excerpt length is 55 words        return 110;}add_filter(‘excerpt_length’, ‘my_custom_excerpt_length’);


34. What are widgets?
The widgets are add-ons generally displayed in a sidebar of your wordpress theme.

But you can place a widget anywhere on your site. By default, WordPress has several Widgets like Latest Posts, Latest Comments, Search, Categories, Navigation Menu, Custom HTML, and more.


35. How to register a sidebar?
The register_sidebar() function will define a single sidebar in your wordpress theme.

function register_widgets_area()     register_sidebar( array(        ‘name’          => __( ‘Main Sidebar’, ‘textdomain’ ),        ‘id’            => ‘sidebar-1’,    ) );}add_action( ‘widgets_init’, ‘register_widgets_area’ );{


36. What are shortcodes?
Shortcodes are special features in WordPress that add dynamic content to posts, pages, and custom post types.

Contact forms, advertisement banners, greeting messages, and social media shares are dynamic content on a webpage.

The WordPress shortcodes are enclosed in square brackets like this:[my_shortcode]

Default shortcodes:

– displays an image gallery

– embeds and plays an audio file


37. How to display a shortcode?
We can display the shortcodes in our WordPress template using the function do_shortcode().

<?php echo do_shortcode(‘[greeting_message]’); ?>


38. WordPress objects are pass-by-value or pass-by-reference
All WordPress objects are pass-by-value only.


39. How many tables are there in WordPress by default?
In WordPress 6.X, there are 12 tables in the MySQL database.


40. What is a meta box?
A meta box is a draggable box displayed in the post editing screen that allows users to add additional information in a post, page, and custom post type.


41. How to make a WordPress website secure?
We can improve WordPress security in several ways:

  1. Add SSL protocol
  2. Choose a secure hosting services
  3. Secure the login process by changing the default login url and limiting login attempt
  4. Enable captcha validation
  5. Sanitize form inputs
  6. Update WordPress, plugins, and themes to latest version
  7. Add security and firewall plugin
  8. Use nonce

42. What is nonce?
The nonce is used to protect your WordPress website from malicious attacks such as Cross-Site Request Forgeries (CSRFs).


43. What types of websites have you created in WordPress?
Types of websites I have created on WordPress, such as e-commerce, blog, auction, multisite, and more.


44. What are the plugins you have used?
I have used several plugins for different projects, such as WooCommerce, Elementor, ACF Pro, Newsletter, and a lot more.


45. What are page builders?
Page builders are WordPress plugins that allow users to structure and design responsive web pages in an efficient way.


46. What is $wpdb?
The $wpdb is a global object of the wpdb class and provides access to the WordPress database.


47. Have you used Elementor?
Yes, I have used the Elementor plugin for a few websites.


48. What is multisite?
Multisite is a popular feature of WordPress that helps us to create and run multiple websites using the same WordPress installation.


49. What is WooCommerce and have you used it?
Yes, I have used the WooCommerce plugin for a few projects.

WooCommerce is the best e-commerce plugin that allows users to create and manage online stores using WordPress. It provides many features, such as product listing, checkout process, shipping methods, and more.


50. How to customize WooCommerce templates?
By overriding the WooCommerce template files in the WordPress theme.

Back to list

Leave a Reply

Your email address will not be published. Required fields are marked *