add_filter('show_admin_bar', '__return_false');17. How to hide Directory Browsing in WordPress from server? Add following code in htaccess file
Options -Indexes18. How to display custom field in wordpress?
echo get_post_meta($post->ID, 'keyName', true);19. How to run database Query in WordPress?
$wpdb->query("select * from $wpdb->posts where ID>10 ");20.What types of hooks in wordpress is used? 1)Following are Actions hooks:.
has_action() add_action() do_action() do_action_ref_array() did_action() remove_action() remove_all_actions()2)Following are Filters hooks .
has_filter() add_filter() apply_filters() apply_filters_ref_array() current_filter() remove_filter() remove_all_filters()20.How can you backup your WordPress content? WordPress admin -> Tools -> Import 21. List most commonly functions used in wordpress?
- wp_nav_menu() :- Displays a navigation menu.
- is_page() :- to check if this is page OR NOT, will return boolean value.
- get_the_excerpt() :- Copy the excerpt of the post into a specified variable.
- in_category() :- Check if the specified post is assigned to any of the specified categories OR not.
- the_title():- Displays the title of the post in website.
- the_content():- Displays the contents of the post in website.