' tag. add_action( 'wp_footer', 'aamla_svg_icons', 9999 ); /* * Wrapper functions for displaying site items. * * WordPress core 'add_action()' does not allow to * 1. Pass variables to the called function (Predefined variables in do_action() * can only be passed). * 2. No provision for conditional check before calling a function. * * Therefore, we have to create wrapper functions. Also, these wrapper functions * make code more redable. */ /** * Header items wrapper markup. * * @since 1.0.0 */ function aamla_header_items() { aamla_markup( 'header-items' ); } /** * Site branding wrapper markup. * * @since 1.0.0 */ function aamla_site_branding() { aamla_markup( 'site-branding' ); } /** * Display user actionable items inside site header. * * @since 1.0.0 */ function aamla_user_actions() { get_search_form(); } /** * Site logo display function. * * @since 1.0.0 */ function aamla_site_logo() { the_custom_logo(); } /** * Include header text display template. * * @since 1.0.0 */ function aamla_header_text() { aamla_get_template_partial( 'template-parts/header', 'branding-text' ); } /** * Main navigation markup. * * @since 1.0.0 */ function aamla_main_navigation() { if ( has_nav_menu( 'primary' ) ) { aamla_nav_menu( 'site-navigation', 'primary-menu', esc_html__( 'Site Navigation', 'aamla' ), 'primary', false, array( 'container' => 'div', 'container_id' => 'menu-container', 'container_class' => 'menu-container wrapper', ) ); } } /** * Include page header display template. * * @since 1.0.0 */ function aamla_page_header() { aamla_get_template_partial( 'template-parts/page', 'page-header' ); } /** * Include main loop execution template. * * @since 1.0.0 */ function aamla_main_loop() { aamla_get_template_partial( 'template-parts/loop', 'main-loop' ); } /** * Entry header wrapper markup. * * @since 1.0.0 */ function aamla_entry_header_wrapper() { aamla_markup( 'entry-header' ); } /** * Include entry title display template. * * @since 1.0.0 */ function aamla_entry_title() { if ( ! is_singular() ) { $aamla_categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'aamla' ) ); if ( $aamla_categories_list ) : ?> > post_author ) ) { aamla_get_template_partial( 'template-parts/post', 'entry-author' ); } } /** * Display post pagination on home, archive and search pages. * * @since 1.0.0 */ function aamla_post_pagination() { if ( ! is_singular() ) { the_posts_pagination( array( 'prev_text' => '' . esc_html__( 'Previous', 'aamla' ) . '' . aamla_get_icon( array( 'icon' => 'angle-left' ) ), 'next_text' => '' . esc_html__( 'Next', 'aamla' ) . '' . aamla_get_icon( array( 'icon' => 'angle-right' ) ), 'before_page_number' => '' . esc_html__( 'Page', 'aamla' ) . ' ', ) ); } } /** * Display post navigation on single posts. * * @since 1.0.0 */ function aamla_post_navigation() { if ( is_singular( 'post' ) ) { the_post_navigation( array( 'next_text' => '' . esc_html__( 'Next Post ', 'aamla' ) . ' %title', 'prev_text' => '' . esc_html__( ' Previous Post', 'aamla' ) . ' %title', ) ); } } /** * Display image navigation on image attachment pages. * * @since 1.0.0 */ function aamla_image_navigation() { if ( is_attachment() && wp_attachment_is_image() ) { ?> display( 'ThemeURI' ) . '" rel="nofollow">' . wp_get_theme( get_template() )->display( 'Author' ) . '' ); $output = str_replace( '[current_year]', date_i18n( __( 'Y', 'aamla' ) ), $footer_text ); $output = str_replace( '[site_title]', get_bloginfo( 'name', 'display' ), $output ); $output = str_replace( '[copy_symbol]', '©', $output ); $output = str_replace( '[author_credit]', $author_credit, $output ); printf( '', $output ); // WPCS xss ok. } /** * Add SVG definitions to the site footer. * * @since 1.0.0 */ function aamla_svg_icons() { include_once get_parent_theme_file_path( 'assets/images/icons.svg' ); }