Hello There,
Thanks for writing in! I have logged in and I found out that you added codes in your header.php
and footer.php
. I understand that you need this codes for your site. You were adding the codes incorrectly because in the theme, we do have a different kind of template. Please remove your the header.php and footer.php from your child theme first. To add your custom scripts to the header and footer, please follow this:
- You will need to create a new file in your local computer and insert this code:
<?php
// =============================================================================
// VIEWS/HEADER/BASE.PHP
// -----------------------------------------------------------------------------
// Declares the DOCTYPE for the site, includes the <head>, opens the <body>
// element as well as the .x-root <div> and .x-site <div>.
// =============================================================================
$x_root_atts = x_atts( apply_filters( 'x_root_atts', array( 'id' => 'x-root', 'class' => 'x-root' ) ) );
$x_site_atts = x_atts( apply_filters( 'x_site_atts', array( 'id' => 'x-site', 'class' => 'x-site site' ) ) );
?>
<!DOCTYPE html>
<html class="no-js" <?php language_attributes(); ?>>
<head>
<?php /*?><?php if( is_page('register')) { ?>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#ihc_submit_bttn").bind("click", function(e){
e.preventDefault();
if (jQuery("#stripeToken").val() && jQuery("#stripeEmail").val()){
jQuery(".ihc-form-create-edit").submit();
return true;
}
var p = jQuery("#iumpfinalglobalp").val();
p = p * 100;
if (p==0){
jQuery(".ihc-form-create-edit").submit();
return;
}
if (p<50){
p = 50;
}
iump_stripe.open({
name: jQuery("#iumpfinalglobal_ll").val(),
description: jQuery("#iumpfinalglobal_des").val(),
email: jQuery("[name=user_email]").val(),
amount: p,
currency: jQuery("#iumpfinalglobalc").val()
});
});
});
</script>
<?php } ?><?php */?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<?php wp_head(); ?>
<script type="text/javascript">
jQuery(document).ready(function($){
$(".ihc-ap-menu .ihc-ap-menu-item").last().addClass( "logout_tab" );
$("#upload_review_logo_field .acf-label").append("<div class='new_msgafter'>This logo will be seen on your public review page</div>");
});
</script>
<?php if ( is_user_logged_in() )
{
echo '<style>.dashboard_login{ display :block !important}
.logout_class{display :block !important}
</style>';
}
else
{
echo '<style>.dashboard_login{ display :none !important}
.logout_class{display :none !important}
</style>';
}
?>
</head>
<body <?php body_class(); ?>>
<div <?php echo $x_root_atts; ?>>
<?php do_action( 'x_before_site_begin' ); ?>
<div <?php echo $x_site_atts; ?>>
<?php do_action( 'x_after_site_begin' ); ?>
<?php
// =============================================================================
// VIEWS/FOOTER/BASE.PHP
// -----------------------------------------------------------------------------
// Includes the wp_footer() hook and closes out the .x-site <div>, .x-root
// <div>, <body> and <html> tags.
// =============================================================================
?>
<?php do_action( 'x_before_site_end' ); ?>
</div> <!-- END .x-site -->
<?php do_action( 'x_after_site_end' ); ?>
</div> <!-- END .x-root -->
<?php wp_footer(); ?>
<script>
// function getUserData() {
// FB.api(
// '/171015703492702/',
// 'GET',
// {"fields":"access_token"},
// function(response) {
// // Insert your code here
// //var access = FB.getAuthResponse()['accessToken'];
//
// // console.log(response);
//
// }
// );
//
//
// }
//
// window.fbAsyncInit = function() {
// //SDK loaded, initialize it
// FB.init({
// appId : '1993173804304867',
// xfbml : true,
// version : 'v2.11'
// });
//
// //check user session and refresh it
// FB.getLoginStatus(function(response) {
// if (response.status === 'connected') {
// //user is authorized
//
// // ;
// //document.getElementById('loginBtn').style.display = 'none';
// var test = getUserData();
//
// } else {
// //user is not authorized
// }
// });
// };
//
// //load the JavaScript SDK
// (function(d, s, id){
// var js, fjs = d.getElementsByTagName(s)[0];
// if (d.getElementById(id)) {return;}
// js = d.createElement(s); js.id = id;
// js.src = "//connect.facebook.com/en_US/sdk.js";
// fjs.parentNode.insertBefore(js, fjs);
// }(document, 'script', 'facebook-jssdk'));
//
// //add event listener to login button
// var myEl = document.getElementById('access_token_btn');
//if(myEl){
//
// myEl.addEventListener('click', function() {
//
// /*document.getElementById('access_token_btn').addEventListener('click', function() {*/
// //do the login
// FB.login(function(response) {
// //console.log(response);
//
// if (response.authResponse) {
//
// getUserData();
// }
// }, {scope: 'email, public_profile, user_friends ,manage_pages, publish_stream, read_stream, publish_actions, publish_pages', return_scopes: true});
// }, false);
// }
</script>
</body>
</html>
- Save this file again as
base.php
and upload this one to your child theme’s folder wp-content/themes/pro-child/framework/views/footer/
Once you’ve done everything, we can check again if the one page navigation is working or not. The steps above is crucial because your custom codes affected the whole site and messed up the page structure which invalidates it. We need to fix it first to avoid issues and future issues.
Please let us know how it goes.