HEX
Server: LiteSpeed
System: Linux mail.aatilis.ir 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: www (1000)
PHP: 8.3.30
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/soqatland.com/wp-content/themes/woodmart/inc/modules/search/class-main.php
<?php
/**
 * The Main class.
 *
 * @package woodmart
 */

namespace XTS\Modules\Search;

use XTS\Singleton;

/**
 * The Main class.
 */
class Main extends Singleton {
	/**
	 * Init.
	 */
	public function init() {
		$this->include_files();

		add_action( 'woocommerce_after_shop_loop', array( $this, 'show_blog_results_on_search_page' ), 100 );
		add_action( 'woodmart_after_portfolio_loop', array( $this, 'show_blog_results_on_search_page' ), 100 );
		add_action( 'woodmart_after_no_product_found', array( $this, 'show_blog_results_on_search_page' ), 100 );
	}

	/**
	 * Include files.
	 */
	public function include_files() {
		$files = array(
			'frontend/class-search-form',
			'frontend/class-dropdown-search',
			'frontend/class-full-screen-search',

			'query/class-search-query',
			'query/class-search-with-sku',
			'query/class-search-with-synonyms',
			'query/class-search-with-taxonomies',

			'class-ajax-search',
			'functions',
		);

		foreach ( $files as $file ) {
			require_once get_parent_theme_file_path( WOODMART_FRAMEWORK . '/modules/search/' . $file . '.php' );
		}
	}

	/**
	 * Show blog results on search page.
	 *
	 * @return void
	 */
	public function show_blog_results_on_search_page() {
		if ( ! is_search() || ! woodmart_get_opt( 'enqueue_posts_results' ) ) {
			return;
		}

		$search_query = get_search_query();
		$column       = woodmart_get_opt( 'search_posts_results_column' );
		$blog_results = woodmart_shortcode_blog(
			array(
				'slides_per_view' => $column,
				'blog_design'     => 'carousel',
				'search'          => $search_query,
				'items_per_page'  => 10,
			)
		);

		if ( empty( $blog_results ) ) {
			return;
		}

		$show_all_url = add_query_arg(
			array(
				's'         => esc_attr( $search_query ),
				'post_type' => 'post',
			),
			home_url()
		);

		ob_start();
		?>
		<div class="wd-blog-search-results">
			<h4 class="wd-el-title slider-title">
				<span><?php esc_html_e( 'Results from blog', 'woodmart' ); ?></span>
			</h4>

			<?php echo $blog_results; // phpcs:ignore. ?>

			<div class="wd-search-show-all">
				<a href="<?php echo esc_url( $show_all_url ); ?>" class="button">
					<?php esc_html_e( 'Show all blog results', 'woodmart' ); ?>
				</a>
			</div>
		</div>
		<?php

		echo ob_get_clean(); // phpcs:ignore.
	}
}

Main::get_instance();