From 6967281c6d0dbaa77132a547771bca04c81ac551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20=C3=87=C3=B6mez=20=7C=20Slaweally?= Date: Sun, 3 Nov 2024 01:16:14 +0300 Subject: [PATCH] Update theme-options.php When the searched content is not found in the search results, it gives random content suggestions so that the blank page does not appear. we can determine the number of articles to be suggested in the settings. --- functions/theme-options.php | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/functions/theme-options.php b/functions/theme-options.php index 6559af4..4c904c6 100644 --- a/functions/theme-options.php +++ b/functions/theme-options.php @@ -181,6 +181,36 @@ 'step' => '1', ), ) ); +// Blog: Excerpt Length +Kirki::add_field( 'clearer_theme', array( + 'type' => 'slider', + 'settings' => 'excerpt-length', + 'label' => esc_html__( 'Excerpt Length', 'clearer' ), + 'description' => esc_html__( 'Max number of words. Set it to 0 to disable.', 'clearer' ), + 'section' => 'blog', + 'default' => '20', + 'choices' => array( + 'min' => '0', + 'max' => '100', + 'step' => '1', + ), +) ); + +// Blog: Number of Suggested Posts in Search Results +Kirki::add_field( 'clearer_theme', array( + 'type' => 'slider', + 'settings' => 'suggested-posts-count', + 'label' => esc_html__( 'Number of Suggested Posts in Search Results', 'clearer' ), + 'description' => esc_html__( 'Max number of suggested posts to display. Set to 0 to disable suggestions.', 'clearer' ), + 'section' => 'blog', + 'default' => 5, + 'choices' => array( + 'min' => 0, + 'max' => 10, + 'step' => 1, + ), +) ); + // Blog: Comment Count Kirki::add_field( 'clearer_theme', array( 'type' => 'switch', @@ -744,4 +774,4 @@ function clearer_kirki_sidebars_select() { 'label' => esc_html__( 'Background Color', 'clearer' ), 'section' => 'styling', 'default' => '#fbfbfc', -) ); \ No newline at end of file +) );