- Use of multiple plugins can make website heavy to load and slow
- Only utilizes PHP
- Sometimes updates can lead to loss of data, so you always need a backup copy
- Modifying images and tables are difficult.
How to enable DEBUG mode in WordPress?
You can enable debug mode in WP by editing wp-config.php file and changing WP_DEBUG constant value to true.
What steps we would take if a WordPress site is hacked?
- Install a security plugin.
- Re-install the latest version of WordPress.
- Change password and User-IDs for all your users.
- Check your themes and plugins are up to date.
- Scan the system using Anti-virus program integrated into your hosting panel.
What are the template tags in WordPress?
A template tag is a code that instructs WordPress to “do” or “get” something. Like in the header.php, we use the tag bloginfo ( ‘name’ ) to get “Site Title” from the wp-options table which is set in Setting > General in WordPress admin.
The the_title() template tag is used to display the post title.
wp_list_cats() is to display categories.
get_header() for getting header.
get_sidebar() to display the sidebar on page.
get_footer() to get the footer content on page.
What user roles are available in WordPress?
WordPress has these six roles has by default and each role has several capabilities.
- Super Admin (Multisite)
- Administrator
- Editor
- Author
- Contributor
- Subscriber
What are the features of WordPress?
WordPress powers more than 28% of the web and this figure is not limited it rises every day. Everything from simple websites, to blogs, to complex portals and enterprise websites, and even applications, are built with WordPress.
Here are some of the features of WordPress.
- It’s Simplicity
- Easier publishing tools
- Search Engine Optimized
- User Management
- Media Management
- Easy Theme System
- Extend Easily with Plugins
- Multilingual Support
- Easy Installation and Upgrades
- Multilingual Support
- Built-in Comments System
- Custom Content Types
What are the rules that you have to follow for WordPress plugin development?
- Create a unique name
- Create the plugin’s folder
- Create a sub-folder for PHP files, translations, and assets
- Create the main plug-in file and fill in the header information
- Create activation and de-activation functions
- Create an uninstall script
- Create a readme.txt file
- To detect paths to plugin file use proper constants and functions
What are the positive aspects of WordPress?
- Easy installation and upgrade
- In-built SEO engine
- Easy theme system
- Flexibility
- Multilingual- available in more than 70 languages
- Own data- no unwanted advert on your website
- Flexibility and Easy publishing option
How to add custom field under WordPress general settings
To add custom fields under WordPress general settings without hacking core code, use the below example. Here’s how to add custom field under WordPress general settings page.
add_filter('admin_init', 'register_my_general_settings_fields'); function register_my_general_settings_fields()
{
register_setting('general', 'custom_field', 'esc_attr');
add_settings_field('custom_field', '<label for="custom_field">'.__('Custom Field' , 'custom_field' ).'</label>' , 'general_settings_custom_fields_html', 'general');
}
function general_settings_custom_fields_html()
{
$value = get_option( 'custom_field', '' );
echo '<input type="text" id="custom_field" name="custom_field" value="' . $value . '" />';
}
Please let me know, If you have any queries or feedback.
How to add Custom Sidebars or Widget Area in WordPress
Sidebars allow you display widgets inside your theme. In this post, we will teach you the way to create sidebar and display that sidebar in your theme.
First thing you need to do is register the sidebar or widget area. So copy the below code and paste in your functions.php file. Once you registered the sidebar, It will be displayed in your Appearance => Widget screen in the backend.(WP admin).
function register_sidebar_widget() { register_sidebar( array( 'name' =>__( 'Sidebar', 'wpb'), 'id' => 'sidebar', 'description' => __( 'Appears on the static front page template', 'wpb' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); } add_action( 'widgets_init', 'register_sidebar_widget' );
Now You need to copy and paste the below code in your template files to display the sidebar.
<?php if ( is_active_sidebar( 'sidebar' ) ) : ?> <div id="secondary" class="widget-area" role="complementary"> <?php dynamic_sidebar( 'sidebar' ); ?> </div> <?php endif; ?>
In this example codes, we have registered and displayed the widget are in template files.
Please let me know, If you have any queries or feedback.