0
我正在WordPress的目錄網站,當我嘗試我得到這個錯誤的搜索選項:WordPress的錯誤:警告非法偏移
警告:非法串偏移「場」在/ home/dalilouk /public_html/wp-content/themes/directory/header.php on line 27
警告:/home/dalilouk/public_html/wp-content/themes/directory/header.php在線的非法字符串偏移「字段」 33
而搜索的結果總是「找不到」。
這是header.php中從第27行的代碼:
<script type="text/javascript"> #line 27
jQuery(document).ready(function($) {
{ifset $themeOptions->search->searchCategoriesHierarchical}
var categories = [ {!$categoriesHierarchical} ];
{else}
var categories = [ #line 33
{foreach $categories as $cat}
{ value: {$cat->term_id}, label: {$cat->name} }{if !($iterator->last)},{/if}
{/foreach}
];
{/ifset}
{ifset $themeOptions->search->searchLocationsHierarchical}
var locations = [ {!$locationsHierarchical} ];
{else}
var locations = [
{foreach $locations as $loc}
{ value: {$loc->term_id}, label: {$loc->name} }{if !($iterator->last)},{/if}
{/foreach}
];
{/ifset}
var catInput = $("#dir-searchinput-category"),
catInputID = $("#dir-searchinput-category-id"),
locInput = $("#dir-searchinput-location"),
locInputID = $("#dir-searchinput-location-id");
catInput.autocomplete({
minLength: 0,
source: categories,
focus: function(event, ui) {
var val = ui.item.label.replace(/&/g, "&");
val = val.replace(/ /g, " ").replace(/'/g, "'");
catInput.val(val);
return false;
},
select: function(event, ui) {
var val = ui.item.label.replace(/&/g, "&");
val = val.replace(/ /g, " ").replace(/'/g, "'");
catInput.val(val);
catInputID.val(ui.item.value);
return false;
}
}).data("ui-autocomplete")._renderItem = function(ul, item) {
return $("<li>")
.data("item.autocomplete", item)
.append("<a>" + item.label + "</a>")
.appendTo(ul);
};
var catList = catInput.autocomplete("widget");
catList.niceScroll({ autohidemode: false });
catInput.click(function(){
catInput.val('');
catInputID.val('0');
catInput.autocomplete("search", "");
});
locInput.autocomplete({
minLength: 0,
source: locations,
focus: function(event, ui) {
var val = ui.item.label.replace(/&/g, "&");
val = val.replace(/ /g, " ").replace(/'/g, "'");
locInput.val(val);
return false;
},
select: function(event, ui) {
var val = ui.item.label.replace(/&/g, "&");
val = val.replace(/ /g, " ").replace(/'/g, "'");
locInput.val(val);
locInputID.val(ui.item.value);
return false;
}
}).data("ui-autocomplete")._renderItem = function(ul, item) {
return $("<li>")
.data("item.autocomplete", item)
.append("<a>" + item.label + "</a>")
.appendTo(ul);
};
var locList = locInput.autocomplete("widget");
locList.niceScroll({ autohidemode: false });
locInput.click(function(){
locInput.val('');
locInputID.val('0');
locInput.autocomplete("search", "");
});
{ifset $_GET['dir-search']}
// fill inputs with search parameters
$('#dir-searchinput-text').val({$searchTerm});
catInputID.val({$_GET["categories"]});
for(var i=0;i<categories.length;i++){
if(categories[i].value == {$_GET["categories"]}) {
var val = categories[i].label.replace(/&/g, "&");
val = val.replace(/ /g, " ").replace(/'/g, "'");
catInput.val(val);
}
}
locInputID.val({$_GET["locations"]});
for(var i=0;i<locations.length;i++){
if(locations[i].value == {$_GET["locations"]}) {
var val = locations[i].label.replace(/&/g, "&");
val = val.replace(/ /g, " ").replace(/'/g, "'");
locInput.val(val);
}
}
{/ifset}
});
</script>
請幫我解決這個問題。
感謝您的回覆,對不起,我是新手,能否告訴我該如何找到.php文件? – Rori
你部署了應用程序(很多.php文件)到你的服務器,可能通過ftp/sftp :)所以,你也可以從你的ftp/sftp下載它。 – Anton