'; echo 'Home'; echo ' ' . esc_html($separator) . ' '; if (is_single()) { the_category(' ' . esc_html($separator) . ' '); echo ' ' . esc_html($separator) . ' '; the_title(); } elseif (is_category()) { single_cat_title(); } echo ''; } } /** * EXAMPLE 3: Customizing excerpt */ function example_custom_excerpt_length($length) { return apus_get_excerpt_length(); } add_filter('excerpt_length', 'example_custom_excerpt_length'); function example_custom_excerpt_more($more) { return apus_get_excerpt_more(); } add_filter('excerpt_more', 'example_custom_excerpt_more'); /** * EXAMPLE 4: Displaying related posts in single.php */ function example_display_related_posts() { if (apus_show_related_posts() && is_single()) { $count = apus_get_related_posts_count(); $taxonomy = apus_get_related_posts_taxonomy(); $title = apus_get_related_posts_title(); // Get related posts $post_id = get_the_ID(); $args = array( 'posts_per_page' => $count, 'post__not_in' => array($post_id), ); if ($taxonomy === 'category') { $categories = wp_get_post_categories($post_id); if ($categories) { $args['category__in'] = $categories; } } elseif ($taxonomy === 'tag') { $tags = wp_get_post_tags($post_id, array('fields' => 'ids')); if ($tags) { $args['tag__in'] = $tags; } } $related = new WP_Query($args); if ($related->have_posts()) { ?>

' . wp_kses_post($copyright) . ''; } } /** * EXAMPLE 10: Custom CSS in header */ function example_add_custom_css() { $custom_css = apus_get_custom_css(); if ($custom_css) { echo '\n"; } } add_action('wp_head', 'example_add_custom_css', 100); /** * EXAMPLE 11: Custom JS in header */ function example_add_custom_js_header() { $custom_js = apus_get_custom_js_header(); if ($custom_js) { echo '\n"; } } add_action('wp_head', 'example_add_custom_js_header', 100); /** * EXAMPLE 12: Custom JS in footer */ function example_add_custom_js_footer() { $custom_js = apus_get_custom_js_footer(); if ($custom_js) { echo '\n"; } } add_action('wp_footer', 'example_add_custom_js_footer', 100); /** * EXAMPLE 13: Posts per page for archives */ function example_set_archive_posts_per_page($query) { if ($query->is_archive() && !is_admin() && $query->is_main_query()) { $posts_per_page = apus_get_archive_posts_per_page(); $query->set('posts_per_page', $posts_per_page); } } add_action('pre_get_posts', 'example_set_archive_posts_per_page'); /** * EXAMPLE 14: Performance optimizations */ function example_apply_performance_settings() { // Remove emoji scripts if (apus_is_performance_enabled('remove_emoji')) { remove_action('wp_head', 'print_emoji_detection_script', 7); remove_action('wp_print_styles', 'print_emoji_styles'); } // Remove embeds if (apus_is_performance_enabled('remove_embeds')) { wp_deregister_script('wp-embed'); } // Remove Dashicons for non-logged users if (apus_is_performance_enabled('remove_dashicons') && !is_user_logged_in()) { wp_deregister_style('dashicons'); } } add_action('wp_enqueue_scripts', 'example_apply_performance_settings', 100); /** * EXAMPLE 15: Lazy loading images */ function example_add_lazy_loading($attr, $attachment, $size) { if (apus_is_lazy_loading_enabled()) { $attr['loading'] = 'lazy'; } return $attr; } add_filter('wp_get_attachment_image_attributes', 'example_add_lazy_loading', 10, 3); /** * EXAMPLE 16: Layout classes based on settings */ function example_get_layout_class() { $layout = 'right-sidebar'; // default if (is_single()) { $layout = apus_get_default_post_layout(); } elseif (is_page()) { $layout = apus_get_default_page_layout(); } return 'layout-' . $layout; } /** * EXAMPLE 17: Display post meta conditionally */ function example_display_post_meta() { if (!apus_get_option('show_post_meta', true)) { return; } ?>
', ', ', ''); } } /** * EXAMPLE 19: Get all options (for debugging) */ function example_debug_all_options() { if (current_user_can('manage_options') && isset($_GET['debug_options'])) { $all_options = apus_get_all_options(); echo '
';
        print_r($all_options);
        echo '
'; } } add_action('wp_footer', 'example_debug_all_options'); /** * EXAMPLE 20: Check if specific feature is enabled */ function example_check_feature() { // Multiple ways to check boolean options // Method 1: Using helper function if (apus_is_option_enabled('enable_breadcrumbs')) { // Breadcrumbs are enabled } // Method 2: Using get_option with default if (apus_get_option('enable_related_posts', true)) { // Related posts are enabled } // Method 3: Direct check $options = apus_get_all_options(); if (isset($options['enable_lazy_loading']) && $options['enable_lazy_loading']) { // Lazy loading is enabled } }