• Hallo,

    Normaliter lukt het me aardig om iets aan te passen in een themeheader. Banner of foto toevoegen of juist verwijderen.

    Voor een nieuwe site van mij gebruik ik “Directory WordPress Theme” iets teveel overkill maar de layout bevalt me prima met een woocommerce webshop.
    Nu staat er in de header een zoekbalk met keyword, location en categorys. Een funcie van dit thema die ik dus helemaal niet gebruik.

    Mijn probleem is hoe ik het weg kan krijgen. Ben in de header dagenlang bezig geweest. krijg het er wel uit maar dan verdwijnt de slider ook en die wil ik juist graag behouden.

    Hier is de code van de header misschien dat ik het ergens anders moet zoeken bijvoorbeeld in templates/header? of in de css file maar daar ben ik een echte leek in.

    <?php
    
    /**
     * AIT WordPress Theme
     *
     * Copyright (c) 2012, Affinity Information Technology, s.r.o. (http://ait-themes.com)
     */
    
    global $aitThemeOptions, $latteParams, $wp_query, $registerErrors, $registerMessages;
    
    // register form errors
    if(isset($registerErrors)){
    	$latteParams['registerErrors'] = $registerErrors->get_error_message();
    }
    // register form info
    if(isset($registerMessages)){
    	$latteParams['registerMessages'] = $registerMessages;
    }
    
    $mapCategory = 0;
    $mapLocation = 0;
    $mapSearch = $wp_query->query_vars['s'];
    // parse tax query - only one category and location
    if(isset($wp_query->tax_query)){
    	$taxQueries = $wp_query->tax_query->queries;
    	foreach ($taxQueries as $tax) {
    		if($tax['field'] == 'id'){
    			if($tax['taxonomy'] == 'ait-dir-item-category'){
    				$mapCategory = (isset($tax['terms'][0])) ? $tax['terms'][0] : 0;
    			} elseif ($tax['taxonomy'] == 'ait-dir-item-location') {
    				$mapLocation = (isset($tax['terms'][0])) ? $tax['terms'][0] : 0;
    			}
    		} elseif ($tax['field'] == 'slug') {
    			if($tax['taxonomy'] == 'ait-dir-item-category'){
    				$mapCategory = (isset($tax['terms'][0])) ? get_term_by( 'slug', $tax['terms'][0], 'ait-dir-item-category' )->term_id : 0;
    			} elseif ($tax['taxonomy'] == 'ait-dir-item-location') {
    				$mapLocation = (isset($tax['terms'][0])) ? get_term_by( 'slug', $tax['terms'][0], 'ait-dir-item-location' )->term_id : 0;
    			}
    		}
    	}
    }
    $latteParams['mapCategory'] = $mapCategory;
    $latteParams['mapLocation'] = $mapLocation;
    $latteParams['mapSearch'] = $mapSearch;
    
    // for search form
    $categories = get_terms('ait-dir-item-category', array(
    	'hide_empty'		=> false,
    	'orderby'			=> 'name'
    ));
    $latteParams['categories'] = $categories;
    $locations = get_terms('ait-dir-item-location', array(
    	'hide_empty'		=> false,
    	'orderby'			=> 'name'
    ));
    $latteParams['locations'] = $locations;
    
    // hierarchical autocomplete
    if (isset($aitThemeOptions->search->searchCategoriesHierarchical)) {
    	$hCategories = array();
    	aitSortTermsHierarchicaly($categories, $hCategories);
    	$latteParams['categoriesHierarchical'] = substr(aitGenerateHirerarchicalAutocomplete($hCategories), 0, -1);
    }
    if (isset($aitThemeOptions->search->searchLocationsHierarchical)) {
    	$hLocations = array();
    	aitSortTermsHierarchicaly($locations, $hLocations);
    	$latteParams['locationsHierarchical'] = substr(aitGenerateHirerarchicalAutocomplete($hLocations), 0, -1);
    }
    
    // directory search
    if(isset($_GET['dir-search'])){
    	$latteParams['searchTerm'] = $wp_query->query_vars['s'];
    
    	$latteParams['isGeolocation'] = (isset($_GET['geo'])) ? true : null;
    	$latteParams['geolocationRadius'] = (isset($_GET['geo-radius'])) ? $_GET['geo-radius'] : 100;
    	$latteParams['geolocationCircle'] = (isset($aitThemeOptions->search->showAdvancedSearchRadius)) ? true : null;
    	if(isset($aitThemeOptions->search->searchShowMap)){
    		// map
    		$latteParams['headerType'] = 'map';
    		$radius = array();
    		if(isset($_GET['geo'])){
    			$radius[] = $_GET['geo-radius'];
    			$radius[] = $_GET['geo-lat'];
    			$radius[] = $_GET['geo-lng'];
    		}
    		$latteParams['items'] = getItems($_GET['categories'],$_GET['locations'],$wp_query->query_vars['s'],$radius);
    	} else {
    		$latteParams['headerType'] = 'none';
    	}
    } else if(isset($latteParams['isDirTaxonomy']) || isset($latteParams['isDirSingle'])){
    	// map
    	$latteParams['headerType'] = 'map';
    	$latteParams['isGeolocation'] = (isset($aitThemeOptions->directoryMap->enableGeolocation)) ? true : null;
    	//$latteParams['geolocationOnlyInRadius'] = (isset($aitThemeOptions->directoryMap->geolocationOnlyInRadius)) ? true : null;
    	$latteParams['geolocationRadius'] = (isset($aitThemeOptions->directoryMap->geolocationRadius)) ? $aitThemeOptions->directoryMap->geolocationRadius : 100;
    	$latteParams['geolocationCircle'] = (isset($aitThemeOptions->directoryMap->geolocationCircle)) ? true : null;
    } else {
    	// LOCAL
    	if(!empty($latteParams['post']) && isset($latteParams['post']->options('header')->overrideGlobal)){
    		$latteParams['headerType'] = $latteParams['post']->options('header')->headerType;
    		switch ($latteParams['post']->options('header')->headerType) {
    			case 'map':
    				$latteParams['items'] = getItems();
    				// geolocation
    				$latteParams['isGeolocation'] = (isset($latteParams['post']->options('header')->enableGeolocation)) ? true : null;
    				//$latteParams['geolocationOnlyInRadius'] = (isset($latteParams['post']->options('header')->geolocationOnlyInRadius)) ? true : null;
    				$latteParams['geolocationRadius'] = (isset($latteParams['post']->options('header')->geolocationRadius)) ? $latteParams['post']->options('header')->geolocationRadius : 100;
    				$latteParams['geolocationCircle'] = (isset($latteParams['post']->options('header')->geolocationCircle)) ? true : null;
    				break;
    			case 'image':
    				$latteParams['headerImage'] = $latteParams['post']->options('header')->image;
    				$latteParams['headerImageSize'] = aitGetImageSize($latteParams['post']->options('header')->image);
    				break;
    			case 'slider':
    				$latteParams['headerSlider'] = $latteParams['post']->options('header')->slider;
    				break;
    			default:
    				break;
    		}
    	// GLOBAL
    	} else {
    		$latteParams['headerType'] = $aitThemeOptions->header->headerType;
    		switch ($aitThemeOptions->header->headerType) {
    			case 'map':
    				$latteParams['items'] = getItems();
    				// geolocation
    				$latteParams['isGeolocation'] = (isset($aitThemeOptions->directoryMap->enableGeolocation)) ? true : null;
    				//$latteParams['geolocationOnlyInRadius'] = (isset($aitThemeOptions->directoryMap->geolocationOnlyInRadius)) ? true : null;
    				$latteParams['geolocationRadius'] = (isset($aitThemeOptions->directoryMap->geolocationRadius)) ? $aitThemeOptions->directoryMap->geolocationRadius : 100;
    				$latteParams['geolocationCircle'] = (isset($aitThemeOptions->directoryMap->geolocationCircle)) ? true : null;
    				break;
    			case 'image':
    				$latteParams['headerImage'] = $aitThemeOptions->header->image;
    				$latteParams['headerImageSize'] = aitGetImageSize($aitThemeOptions->header->image);
    				break;
    			case 'slider':
    				$latteParams['headerSlider'] = $aitThemeOptions->header->slider;
    				break;
    			default:
    				break;
    		}
    	}
    }
    
    WPLatte::createTemplate(basename(__FILE__, '.php'), $latteParams)->render();
6 reacties aan het bekijken - 1 tot 6 (van in totaal 6)
  • Thread starter Hank_Chinasky

    (@hank_chinasky)

    Sorry de link naar de site is

    Thread starter Hank_Chinasky

    (@hank_chinasky)

    Als je echt even een simpele “hack” of dirty trick wilt kun je dit in de css zetten:

    input#dir-searchinput-location,
    input#dir-searchinput-category {
    
    display: none;
    }

    Dan zijn die 2 zoekvelden verborgen zonder dat je iet verkeerd kan doen in de header code.

    Zet deze code overigens in de style.css

    Of via een enorm luie methode in je header.php

    <style>
    input#dir-searchinput-location,
    input#dir-searchinput-category {
    
    display: none;
    }
    </style>

    Maar dit is inline code en dat kun je beter niet doen.

    Thread starter Hank_Chinasky

    (@hank_chinasky)

    Ik heb het in de css geplaatst maar alleen het location veld is nu verdwenen.
    De velden category en search keyword veld zijn nog steeds aanwezig?

    Graag zou ik de hele witte balk zien verdwijnen.

    Ahh dan neem je de gehele bar:

    #dir-search-inputs,
    #dir-search-button {
    
    display: none;
    }
    Thread starter Hank_Chinasky

    (@hank_chinasky)

    Die werkt! Echter inclusief de blauwe rand.

    Ontzettend bedankt!

6 reacties aan het bekijken - 1 tot 6 (van in totaal 6)
  • Het onderwerp ‘Header hack’ is gesloten voor nieuwe reacties.