After installing and activating a new WordPress theme, what is the immediate visible effect on your website?
Think about what a theme controls in WordPress.
Activating a new theme changes the look and feel of your site by applying the theme's design and layout. It does not delete content or change URLs.
In a WordPress theme's template file, which function call correctly includes the header part of the site?
WordPress has specific functions for template parts starting with 'get_'.
The function get_header(); is the standard WordPress function to include the header template file.
Consider this WordPress loop snippet inside a theme template:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <h2><?php the_title(); ?></h2> <?php endwhile; else : ?> <p>No posts found.</p> <?php endif; ?>
If there are no posts published, what will this code output?
Look at the else part of the if statement.
If no posts exist, the else block runs and outputs <p>No posts found.</p>.
Given this shortcode function in functions.php:
function my_shortcode() {
return 'Hello, world!';
}
add_shortcode('greet', 'my_shortcode');When you add [greet] in a post, nothing appears. What is the likely cause?
Shortcodes need to be processed inside the content output.
If the theme does not use the_content() function to display post content, shortcodes won't be processed and will not show output.
Which statement best describes the main purpose of the WordPress REST API?
Think about how apps or other websites might interact with WordPress data.
The REST API provides a way for external programs to interact with WordPress content through standard web requests, enabling headless setups and integrations.