我正在使用之前使用的主题,而wp_footer在那里正常加载。但是在新网站上wp_footer没有加载无法自己找到解决方案!有人可以帮助我吗?
它位于</body>
标记之前的正确位置。
<footer>
<div class="container">
<div class="footermenu">
<?php
$footer = array(
'theme_location' => '',
'menu' => 'footer',
'container' => 'div',
'container_class' => '',
'container_id' => '',
'menu_class' => 'menu',
'menu_id' => '',
'echo' => true,
'fallback_cb' => 'wp_page_menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
'depth' => 0,
'walker' => ''
);
wp_nav_menu($footer);
?>
<img src="http://www.web-lynx.nl/vandervalk/wp-content/uploads/2014/07/PBRB_logo-trans-300x41.png" width="300px" height="41px" class="logofooter"/>
<div class="clear"></div>
</div>
<h2><?php _e("ONZE SOCIAL MEDIA","vertaling"); ?></h2>
<div class="one_third">
<a href="https://www.facebook.com/PlazaResortBonaire" class="linkicon"><span data-icon="" class="footersocial"></span></a>
</div>
<div class="one_third">
<a href="https://twitter.com/plazabonaire" class="linkicon"><span data-icon="" class="footersocial"></span></a>
</div>
<div class="one_third">
<a href="http://instagram.com/plazaresortbonaire" class="linkicon"><span data-icon="" class="footersocial"></span></a>
</div>
<div class="clear"></div>
<br>
Copyright © Van der Valk
</div>
</footer><!-- footer -->
</div><!-- site-wrapper -->
<script type="text/javascript">
jQuery('.googlemaps').click(function(){
if(jQuery('.gmap').css('display') == 'none'){
jQuery('.gmap').slideDown();
}else{
jQuery('.gmap').slideUp();
}
});
jQuery('.firstphone').click(function(){
jQuery('.otherphonenumbers').slideDown();
});
</script>
<script>
/*!
* classie v1.0.0
* class helper functions
* from bonzo https://github.com/ded/bonzo
* MIT license
*
* classie.has( elem, 'my-class' ) -> true/false
* classie.add( elem, 'my-new-class' )
* classie.remove( elem, 'my-unwanted-class' )
* classie.toggle( elem, 'my-class' )
*/
/*jshint browser: true, strict: true, undef: true, unused: true */
/*global define: false */
( function( window ) {
'use strict';
// class helper functions from bonzo https://github.com/ded/bonzo
function classReg( className ) {
return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
}
// classList support for class management
// altho to be fair, the api sucks because it won't accept multiple classes at once
var hasClass, addClass, removeClass;
if ( 'classList' in document.documentElement ) {
hasClass = function( elem, c ) {
return elem.classList.contains( c );
};
addClass = function( elem, c ) {
elem.classList.add( c );
};
removeClass = function( elem, c ) {
elem.classList.remove( c );
};
}
else {
hasClass = function( elem, c ) {
return classReg( c ).test( elem.className );
};
addClass = function( elem, c ) {
if ( !hasClass( elem, c ) ) {
elem.className = elem.className + ' ' + c;
}
};
removeClass = function( elem, c ) {
elem.className = elem.className.replace( classReg( c ), ' ' );
};
}
function toggleClass( elem, c ) {
var fn = hasClass( elem, c ) ? removeClass : addClass;
fn( elem, c );
}
var classie = {
// full names
hasClass: hasClass,
addClass: addClass,
removeClass: removeClass,
toggleClass: toggleClass,
// short names
has: hasClass,
add: addClass,
remove: removeClass,
toggle: toggleClass
};
// transport
if ( typeof define === 'function' && define.amd ) {
// AMD
define( classie );
} else {
// browser global
window.classie = classie;
}
})( window );
(function( window ){
var body = document.body,
mask = document.createElement("div"),
togglePushLeft = document.querySelector( ".toggle-push-left" ),
pushMenuLeft = document.querySelector( ".push-menu-left" ),
activeNav
;
mask.className = "mask";
/* push menu left */
togglePushLeft.addEventListener( "click", function(){
classie.add( body, "pml-open" );
document.body.appendChild(mask);
activeNav = "pml-open";
} );
/* hide active menu if mask is clicked */
mask.addEventListener( "click", function(){
classie.remove( body, activeNav );
activeNav = "";
document.body.removeChild(mask);
} );
})( window );
</script>
<?php wp_footer(); ?>
</body>
</html>
认为它与此错误有关!
wp-content/themes/ParadiseHotel/st-framework/admin/page-builder/page-builder.php:50 - Undefined variable: ajax_nonce
此变量设置如下
<?php
#-------------------------------------------------------------
# Smooth Theme Framework Version
#-------------------------------------------------------------
function st_framework_version_init(){
$st_framework_version = '1.0';
if(get_option('st_framework_version_init') != $st_framework_version){
update_option('st_framework_version',$st_framework_version);
}
}
add_action('init','st_framework_version_init',10);
#-------------------------------------------------------------
# Define Admin Path and URL
#-------------------------------------------------------------
define('ST_ADMIN_PATH',dirname(__FILE__));
define('ST_ADMIN_URL',ST_URL.'admin');
define('ST_PAGE_TITLE',ST_THEME_NAME.' Settings Page'); // Theme Option Title
define('ST_MENU_TITLE',ST_THEME_NAME); // Theme Option Menu Title
define('ST_PAGE_SLUG','smooththemes'); // Theme Option URL Slug
#-------------------------------------------------------------
# Load the required Framework Files
#-------------------------------------------------------------
// kiểm tra tính hợp lệ của ajax
$current_user = wp_get_current_user();
$ajax_nonce = wp_create_nonce($current_user->ID);
//check_ajax_referer( $current_user->ID, 'ajax_nonce' );
if(is_admin()){
add_action( 'wp_ajax_smooththemes_save_option_action', 'smooththemes_save_option_action' );
function smooththemes_save_option_action() {
$st_default_lang_code = get_bloginfo('language'); // DO NOT REMOVE
if(isset($_POST['save']) && $_POST['save']=='Y'){
$data = array();
foreach( $_POST as $key => $arr ){
if(strpos($key, ST_SETTINGS_OPTION)!==false){
$k = str_replace(ST_SETTINGS_OPTION.'_', '', $key);
$data[$k]= $arr;
}
}
if(st_is_wpml()){
// ICL_LANGUAGE_CODE
// echo var_dump($st_default_lang_code,ICL_LANGUAGE_CODE);
if($st_default_lang_code==ICL_LANGUAGE_CODE || ICL_LANGUAGE_CODE=='' || strpos($st_default_lang_code,ICL_LANGUAGE_CODE)!==false){
// update_option(ST_FRAMEWORK_SETTINGS_OPTION,$_POST[ST_FRAMEWORK_SETTINGS_OPTION]);
update_option(ST_SETTINGS_OPTION,$data);
}
update_option(ST_SETTINGS_OPTION.'_'.ICL_LANGUAGE_CODE, $data);
do_action('st_save_options',$data);
}else{
echo ST_SETTINGS_OPTION;
update_option(ST_SETTINGS_OPTION,$data);
do_action('st_save_options', $data );
}
flush_rewrite_rules();
}
echo 1;
die();
}
// for media
function st_image_attachment_fields_to_edit($form_fields, $post){
$form_fields["st_custom"]["label"] = '';
$form_fields["st_custom"]["input"] = "html";
$image_attributes = wp_get_attachment_image_src( $post->ID ,'medium' ); // returns an array
$form_fields["st_custom"]["html"] = '
<input type="hidden" class="st_attach_btn" data-src = "'.$image_attributes[0].'" post_id ="'.$post->ID.'" >
';
return $form_fields;
}
add_filter("attachment_fields_to_edit", "st_image_attachment_fields_to_edit", null, 99);
//----------------Show image size in mediabox-------------------
function st_insert_custom_image_sizes( $sizes ) {
// get the custom image sizes
global $_wp_additional_image_sizes;
// if there are none, just return the built-in sizes
if ( empty( $_wp_additional_image_sizes ) )
return $sizes;
// add all the custom sizes to the built-in sizes
foreach ( $_wp_additional_image_sizes as $id => $data ) {
// take the size ID (e.g., 'my-name'), replace hyphens with spaces,
// and capitalise the first letter of each word
if ( !isset($sizes[$id]) )
$sizes[$id] = ucfirst( str_replace( '-', ' ', $id ) );
}
return $sizes;
}
add_filter( 'image_size_names_choose', 'st_insert_custom_image_sizes' );
include(ST_ADMIN_PATH.'/editor/editor.php');
include(ST_ADMIN_PATH.'/admin-users.php');
include(ST_ADMIN_PATH.'/admin-functions.php');
include(ST_ADMIN_PATH.'/admin-menu.php');
include(ST_ADMIN_PATH.'/admin-scripts.php');
include(ST_ADMIN_PATH.'/ajax-media.php');
// include(ST_ADMIN_PATH.'/ajax-slidebar-generator.php');
//
if(file_exists(ST_ADMIN_PATH.'/page-builder/page-builder.php')){
include(ST_ADMIN_PATH.'/page-builder/page-builder.php');
}
if(file_exists(ST_ADMIN_PATH.'/review-control/review.php')){
include(ST_ADMIN_PATH.'/review-control/review.php');
}
include(ST_ADMIN_PATH.'/admin-meta-box.php');
include(ST_DIR.'/settings/meta-box-settings.php');
include(ST_ADMIN_PATH.'/admin-post-type.php');
include(ST_ADMIN_DIR.'admin-customize.php');
include(ST_ADMIN_DIR.'post-type-meta/event.php');
include(ST_ADMIN_DIR.'post-type-meta/room.php');
include(ST_ADMIN_DIR.'post-type-meta/gallery.php');
}