Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter jacobwelander

    (@jacobwelander)

    thanks for helpning, but i looked at the search.php and the searchform.php.
    and i cant find any way to add categories.

    ———————– search ———————————————–

    <?php
    /**
     * The main template file.
     *
     * This is the most generic template file in a WordPress theme
     * and one of the two required files for a theme (the other being style.css).
     * It is used to display a page when nothing more specific matches a query.
     * E.g., it puts together the home page when no home.php file exists.
     *
     * @link    https://codex.wordpress.org/Template_Hierarchy
     *
     * @package zonex
     */
    ?>
    <?php get_header(); ?>
    <?php
    
    /* Blog Layout */
    $zonex_blog_layout = zonex_get_option( 'zonex_blog_layout', 'right' );
    
    /* Blog Style */
    $zonex_container_class   = array();
    $zonex_container_class[] = 'search-page';
    $zonex_content_class   = array();
    $zonex_content_class[] = 'main-content';
    
    ?>
        <div class="<?php echo esc_attr( implode( ' ', $zonex_container_class ) ); ?>">
            <div class="container">
                <div class="row">
                    <div class="<?php echo esc_attr( implode( ' ', $zonex_content_class ) ); ?>">
    					<?php get_template_part( 'templates/blog/blog', 'search' ); ?>
                    </div>
                </div>
            </div>
        </div>
    <?php get_footer(); ?>

    ————————- searchform ———————————

    <?php
    /**
     * Template for displaying search forms
     *
     * @package WordPress
     * @subpackage Zonex
     * @since 1.0
     * @version 1.0
     */
    ?>
    
    <?php $unique_id = esc_attr( uniqid( 'search-form-' ) ); ?>
    
    <form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
    	<label for="<?php echo esc_attr($unique_id); ?>">
    		<span class="screen-reader-text"><?php echo _x( 'Search for:', 'label', 'zonex' ); ?></span>
    	</label>
    	<input type="search" id="<?php echo esc_attr($unique_id); ?>" class="search-field" placeholder="<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'zonex' ); ?>" value="<?php echo get_search_query(); ?>" name="s" />
    	<button type="submit" class="search-submit"><span class="screen-reader-text"><?php echo esc_html_x( 'Search', 'submit button', 'zonex' ); ?></span></button>
    </form>
Viewing 1 replies (of 1 total)