Test Questions - Wordpress.docx

Full description...
Author:  Muhammad Rais

17 downloads 218 Views 1MB Size

Recommend Documents

Full description

IQ TestDescrição completa

Descripción: Sample questions for driving test, mainly for St. John's, NL, Canada

California dmv test answersFull description

Psychometric Test Questions Answers for big 4 companies

Sample questions for driving test, mainly for St. John's, NL, Canada

egronomicsDescrição completa

Here are some sample ATPL Questions

Geology related objective questions, mostly asked during tests.

economics solutionsFull description

Psychometric Test Questions Answers

A set of MCQ problems (with answers given at the end) enlisted. For undergraduate students of Physics and Engineering.

Personality Test QuestionsFull description

’; } add_action(‘network_admin_notices’, ‘my_notice’);

136. You need a single post meta value in a bigger post loop and you need it only one time, and you want it to be as fast as possible. How would you proceed? Answers: • Of course, get_post_meta($post->ID, ‘post_meta’, true); — пока это, помечать оценку. • I would use a direct query like: $wpdb->get_var($wpdb->prepare(«SELECT meta_value from $wpdb->postmeta WHERE post_id = %d and meta_key = ‘post_meta’”, $post->ID)); • I would use a direct query like: $wpdb->get_results($wpdb->prepare(«SELECT * from $wpdb->postmeta WHERE meta_key = %s”, ‘post_meta’));

137. How do you enable debug mode in WP? Answers:

• By going to Dashboard > Settings > General and then enable debug mode • By setting WP_DEBUG as true in wp-config.php • It is enabled by default

138. What are the default plugins installed in the WordPress? Note: There may be more than one right answer. Answers: • Contact form7 • Akismet • All in one SEO • Hello Dolly

139. Which function(s) can be used to programatically create a new user in WordPress? Note: There may be more than one right answer. Answers: • wp_update_user • wp_create_user • register_new_user • wp_insert_user

140. Which of the following functions check if current visitor is a logged in user? Answers: • is_visitor_logged_in (); • is_user_logged_in (); • if_user_logged_in (); • is_user_logged ();

141. Which one of the following files is located in the root of your WordPress installation directory and contains your website’s setup details, such as database connection info? Answers: • setup.html • wp-setup.php • wp-config.php • wp-install.php

142. What can the Contributor role do? Answers: • Moderate comments • Publish posts • Edit posts • Edit pages

143. What is common to all these functions: next_post, previous_post, link_pages, the_author_url, wp_get_link? Answers: • They all return URLs • They are all deprecated • They all point to posts or post lists • They all echo something

144. Pick the correct default Post Types readily available to users or internally used by the WordPress installation. Note: There may be more than one right answer. Answers: • Post • Page • Blog • Media • Archive • Category

145. Where can you set a static page as the front page in WP? Answers: • In wp-config.php • In Dashboard->Settings->Reading • In Dashboard->Settings->General • In Dashboard->Appearance

146. How do you check if the current user has the role “administrator”? Note: There may be more than one right answer. Answers:

• current_user_can_do(‘manage_options’); • is_admin(); • current_user_can(‘administrator’); • current_user_can_do(‘manage’); • in_array(‘administrator’,   wp_get_current_user()->roles);

147. Which of the following is true about bloginfo(‘url’); function? Answers: • Displays URL of the active theme’s directory. • Displays the “Site address (URL)” set in Settings > General. This data is retrieved from the “home” record in the wp_options table. • Displays the current post URL. • Displays the “WordPress address (URL)” set in Settings > General. This data is retrieved from the “siteurl” record in the wp_options table.

148. Clean up a comma-separated list of post ids. Example list: 1254,9930,10974,”192”,9930,192 Answers: • array_map(‘absint’, ’1254,9930,10974,”192”,9930,192’); • explode(1254,9930,10974,”192”,9930,192); • wp_parse_id_list(1254,9930,10974,”192”,9930,192);

149. How many WordPress posts can you create? Answers: • WordPress recommends less than 10,000 posts. • WordPress is limited to 1,000 posts. • WordPress has not set any limit. • WordPress is limited to 1,00,000 posts.

150. You need to include a link in a sentence. How can you do that? Answers: • _e( ‘Publish something using our Post by Email feature.’ ); • printf( __( ‘Publish something using our Post by Email fe ature.’), ‘http://support.wordpress.com/post-by-email/ ’ ); • printf( __( ‘Publish something using our %s feature.’ ), sprintf( ‘%s’, __( ‘Post by Email’ ) ) );

151. Assuming we are using ‘wp_’ as the database table prefix, in which table are all the custom fields related to a post stored? Answers: • wp_posts • wp_postmeta • wp_terms

152. Which is the default site update service that WordPress automatically notifies when you publish a new post? Answers: • http://rpc.pingomatic.com • http://google.com • http://ping.feedburner.com • http://www.feedsubmitter.com

153. Which of the following is not a default image size in WP? Answers: • Small Size • Medium Size • Large Size • Thumbnail Size

154. What is a permalink? Answers: • Permalinks are the permanent URLs to your individual weblog posts, as well as categories and other lists of weblog postings. • The numeric IP address of your WordPress site. • The complete URL of your WordPress site. • A popular WordPress plugin.

155. Which of the following is not a default user role in WP? Answers: • Blogger • Author • Subscriber • Contributor

156. How many WordPress themes can be installed in a single WordPress installation? Answers: • 1 • 10 • 100 • Unlimited

157. Arrange the following templates in decreasing order of priority from left to right for Site Front Page: index.php front-page.php home.php Answers: • index.php, front-page.php, home.php • front-page.php, home.php, index.php • home.php, front-page.php, index.php • front-page.php,index.php home.php

158. What database does WordPress use? Answers: • Notes • PostgreSQL • MySQL • Oracle

159. Which of the following files in a WP theme is NOT a file required by the theme review team for acceptance into the WordPress.org theme directory? Answers: • page.php • style.css • index.php • comments.php • screenshot.png

160. Select all of the supported page statuses in WordPress. Note: There may be more than one right answer. Answers: • draft (Draft) • pending (Pending Review) • private (Private) • publish (Published)

161. Which of the following strings is not a default WordPress post format slug? Answers: • aside • image • quote • status

162. Which hook can be used to update kses and TinyMCE to allow select new attributes for an HTML element? Answers: • tool_box • tiny_mce_before_init • tiny_mce_plugins • htmledit_pre

163. Where plugins options are stored in WordPress? Answers: • They are stored in WordPress theme folder. • They are stored in WordPress plugins folder. • They are stored in WordPress.org and not on your site. • They are stored in WordPress Database.

164. When adding a function to the “the_content” hook, where will you see changes? Answers: • On the blog list page. • On the single post page.

• It depends on how your theme is set up. • On the archive page.

165. Which standard WP class do you need to necessarily extend to create your widget? Answers: • WP_Widget •  WP_Widget_Form_Customize_Control • WP_Customize_Control •  WP_Customize_Sidebar_Section

166. Which of the following is true about wp_mail() function? Note: There may be more than one right answer. Answers: • A true return value does not automatically mean that the user received the email successfully. • For this function to work, the settings SMTP and smtp_port (default: 25) need to be set in your php.ini file. • The default content type allows using HTML. • The function can handle only one email as $to parameter.

167. Which hook fires after WordPress has finished loading but before any headers are sent? Answers: • activate_wp_head • init • activate_header • xmirpc_call

168. Which loop is used by default to fetch the posts and loop through them? Answers: • for loop • while loop • foreach loop

169. Pick the default template tag(s). Note: There may be more than one right answer.

Answers: • the_field() • wp_title() • the_title() • wp_field()

170. Arrange the following templates in decreasing order of priority from left to right used to display the posts on a Category page. index.php category.php archive.php category-ID.php category-slug.php Answers: • category-ID.php, category-slug.php, category.php, archive.php, index.php • category-slug.php, archive.php, category.php, category-ID.php, index.php • index.php, category.php, archive.php, category-ID.php, category-slug.php • category-slug.php, category-ID.php, category.php, archive.php, index.php

171. Which function should be used to insert a post title into the title attribute of an HTML element? Answers: • get_the_title(); • the_title_attribute(); • the_title();

172. Which of the following is/are NOT the default abstract methods available in the Walker class for menus? Note: There may be more than one right answer. Answers: • start_lvl() • end_lvl() • start_li() • end_li()

173. What does wp_rand() function? Answers:

• Gets random post ID. • Gets random category ID. • Generates a random post ID for wp_insert_post() function. • Generates a random number.

174. Is it possible to update posts programmatically? Answers: • Yes, with wp_edit_post() function. • Yes, with wp_update_post() function. • Yes, with wp_change_post() function. • No.

175. Where do you change theme name and author details? Answers: • style.css file in the theme folder • index.php file in the theme folder • readme.txt file in the theme folder

176. What is the correct order of priority in decreasing order from left to right for Custom Post Type template files? Answers: • single-{post-type}-{slug}.php, single-{post-type}.php, single.php, singular.php, index.php • single-{post-type}.php, single-{post-type}-{slug}.php, single.php, singular.php, index.php • single-{post-type}.php, single.php, singular.php, single-{post-type}-{slug}.php, index.php • index.php, singular.php, single-{post-type}-{slug}.php, single-{post-type}.php, single.php

177. Which default WP function can be used to assign different classes to the body element? Answers: • body_class() • get_body_classes() • get_theme_support() • sanitize_html_class()

178. What is the name of theme file for a page with slug ‘about-us’? Answers: • about-us.php • page-about-us.php