Complete the code to display the site title in a WordPress theme.
<?php bloginfo([1]); ?>The bloginfo('name') function outputs the site title in WordPress themes.
Complete the code to enqueue a stylesheet in WordPress.
wp_enqueue_style([1], get_template_directory_uri() . '/style.css');
When adding a stylesheet, you give it a handle like 'main-style' to identify it.
Fix the error in the WordPress loop to display post titles.
<?php if (have_posts()) : while ([1]) : the_post(); ?> <h2><?php the_title(); ?></h2> <?php endwhile; endif; ?>
the_post() in the condition causes errors.get_posts() returns an array, not a boolean.The loop condition must call have_posts() to check if posts exist before iterating.
Fill both blanks to register a custom post type in WordPress.
register_post_type([1], [2]);
The first argument is the post type key like 'book'. The second is an array of settings.
Fill all three blanks to create a shortcode that outputs 'Hello World'.
function [1]() { return [2]; } add_shortcode([3], '[1]');
The function name is used to define the shortcode callback. The return is the output string. The shortcode tag is a string identifier.