Questions about this bit of code on my theme

[ad_1]

/* ADD WELCOME TO THE BLOG HOMEPAGE
==================================================== */
if (!function_exists(‘unblock_welcome_intro’)) :
function unblock_welcome_intro($before = ”, $after = ”)
{

// Prints HTML with welcome text.
$welcome_intro_page_id = absint(get_theme_mod(‘welcome_intro_page_id’));
$output = ”;

if (!$welcome_intro_page_id)
return;

if (has_post_thumbnail($welcome_intro_page_id)) {
$output .= sprintf(‘<div class=”unblock-welcome-intro-thumbnail”>%s</div>’, get_the_post_thumbnail($welcome_intro_page_id, ‘thumbnail’));
}

$welcome_intro_page = get_post($welcome_intro_page_id);
$welcome_intro_title = apply_filters(‘the_title’, $welcome_intro_page->post_title, $welcome_intro_page_id);

if ($welcome_intro_title)
$output .= sprintf(‘<h1 class=”entry-title”>%s</h1>’, $welcome_intro_title);

$welcome_intro_content = apply_filters(‘the_content’, $welcome_intro_page->post_content);
$welcome_intro_content = str_replace(‘]]>’, ‘]]&gt;’, $welcome_intro_content);

if ($welcome_intro_content)
$output .= sprintf(‘<div id=”page-intro”>%s</div>’, $welcome_intro_content);

if ($output)
printf(‘%s%s%s’, ‘<header id=”page-header”>’, $output, ‘</header>’);
}

endif;

// Welcome Intro Content
if (!function_exists(‘unblock_welcome_intro_content’)) :
function unblock_welcome_intro_content()
{

if (is_front_page() && get_theme_mod(‘display_welcome_intro_only_on_homepage’, 0)) {
unblock_welcome_intro(‘<div class=”unblock-welcome-intro”>’, ‘</div>’);
} elseif (is_home()) {
unblock_welcome_intro(‘<div class=”unblock-welcome-intro”>’, ‘</div>’);
}
}
endif;
add_action(‘unblock_blog_home_heading’, ‘unblock_welcome_intro_content’);

Can also be looked at here if easier for you: [https://github.com/xVicissitudex/WordPress-Themes/blob/94066711fe6d105f8412613a5c69853eab094595/unblock/inc/template-functions.php#L140])

1) `unblock_welcome_intro($before = ”, $after = ”)` where are the $before and $after parameters used again in the function definition? I can’t see them anywhere else, what is the point of stating these parameters if you aren’t going to use them again?

2) `absint(get_theme_mod(‘welcome_intro_page_id’))` what exactly is welcome\_intro\_page\_id? It’s not anywhere else in the theme, it appears to be a page that contains a logo, tittle, and brief description. Is this a standard word press filter that you can hook on to whenever you allow theme modifications by the user?

3) `get_theme_mod(‘display_welcome_intro_only_on_homepage’, 0))` For get\_theme\_mod, is there somewhere where I can get a list of all the possible values that can go in the first argument? They don’t seem to be present in WordPress codex.

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer