• Brookers55

    (@brookers55)


    Hi,
    I hope someone can help with a website I maintain. Basically when a menu item is clicked the page coding is showing instead of the correct content. The site is https://www.centralexhibitions.co.uk
    This has happened in the last day or so – before there was no problem.
    What do I do to resolve it please? I’m getting desperate.
    Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • have you edited any files whatsoever? It would seem that either the header.php was somehow altered or some specific PHP template in your theme. It seems like the <html> or a <script> tag is somehow missing.

    Thread Starter Brookers55

    (@brookers55)

    I’m not aware of intentionally editing any PHP template although I suspect I could have done unintentionally as I was trying to edit a plug-in script yesterday. Any ideas gratefully received.

    Thread Starter Brookers55

    (@brookers55)

    Has anyone any idea where to look to solve the above problem. I’m at the end of my tether trying to find the root of the problem. Thanks.

    Ok it seems like these pages return a 404 error. And the 404 template of your website is the one that’s broken.

    For example, try this: https://www.centralexhibitions.co.uk/asldkjsalkjd (shouldn’t exist and goes to 404).

    Are you sure that /news is used and a valid permalink of your website?

    Thread Starter Brookers55

    (@brookers55)

    Hi Vassilis,
    Thanks for your help so far. Here is the code that’s showing in the 404.php file. Any ideas what’s wrong with it please? It looks fine to me but I don’t know much about php.
    <?php get_header(); ?>
    <div id=”content”>
    <div id=”error404″ class=”clearfix”>
    <div class=”error404-num grid_8″>404</div>
    <div class=”grid_4″>
    <hgroup>
    <?php echo ‘<h1>’ . __(‘Sorry!’, ‘theme1796’) . ‘</h1>’; ?>
    <?php echo ‘<h2>’ . __(‘Page Not Found’, ‘theme1796’) . ‘</h2>’; ?>
    </hgroup>
    <?php echo ‘<p>’ . __(‘The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.’, ‘theme1796’) . ‘</p>’; ?>
    <?php echo ‘<p>’ . __(‘Please try using our search box below to look for information on the internet.’, ‘theme1796’) . ‘</p>’; ?>
    <?php get_search_form(); /* outputs the default WordPress search form */ ?>
    </div>
    </div><!–#error404 .post–>
    </div><!–#content–>
    <?php get_footer(); ?>

    MyPCHost

    (@mypchost)

    When you load the page: https://www.centralexhibitions.co.uk/show-dates/

    You see the code, it appears to start as:

    pe="text/javascript"></script>
    	<![endif]-->
    	<!--[if (gt IE 9)|!(IE)]><!-->
    		<script src="https://www.centralexhibitions.co.uk/wp-content/themes/theme1796/js/jquery.mobile.customized.min.js" type="text/javascript"></script>
    	<!--<![endif]-->

    For starters, you’ll notice that the very first line of the code pe="text/javascript"></script> — it should be something else, its incomplete. Thats the start of it anyway. The code should be something like: <script type="text/javascript">

    It looks as though the actual code of the header or something has been modified or removed. Just a guess on the header, but there is code clearly missing there.

    Thread Starter Brookers55

    (@brookers55)

    Thanks for that. Next question where would I find that page to edit and hopefully correct it? It doesn’t seem to appear anywhere on the list of pages in Editor menu of the admin area? Sorry for being so dumb.
    Thanks

    Heya, the file you’re looking for is header.php

    Can you paste it here? Although it’s doubtful that it has any problems. I think there’s some sort of problem with some inline javascript or something.

    Have you checked if the /news path is a valid path (assigned to a category or page for example)?

    Looks like there is quite a bit of code missing from header.php. Consider temporarily switching to another theme, delete your current theme and re-upload it, preferably from a fresh copy. Your theme settings are in your database so should not be affected.

    Thread Starter Brookers55

    (@brookers55)

    Hi Vassilis
    Here is the contents of header.php
    I’m at a loss to see anything obviously wrong with it, although I’m not an expert. Thanks for the help so far.
    <!DOCTYPE html>

    <!–[if lt IE 7 ]><html class=”ie ie6″ <?php language_attributes();?>> <![endif]–>
    <!–[if IE 7 ]><html class=”ie ie7″ <?php language_attributes();?>> <![endif]–>
    <!–[if IE 8 ]><html class=”ie ie8″ <?php language_attributes();?>> <![endif]–>
    <!–[if IE 9 ]><html class=”ie ie9″ <?php language_attributes();?>> <![endif]–>
    <!–[if (gt IE 9)|!(IE)]><!–><html <?php language_attributes();?>> <!–<![endif]–>
    <head>
    <title><?php if ( is_category() ) {
    echo __(‘Category Archive for "’, ‘theme1796’); single_cat_title(); echo __(‘" | ‘, ‘theme1796’); bloginfo( ‘name’ );
    } elseif ( is_tag() ) {
    echo __(‘Tag Archive for "’, ‘theme1796’); single_tag_title(); echo __(‘" | ‘, ‘theme1796’); bloginfo( ‘name’ );
    } elseif ( is_archive() ) {
    wp_title(”); echo __(‘ Archive | ‘, ‘theme1796’); bloginfo( ‘name’ );
    } elseif ( is_search() ) {
    echo __(‘Search for "’, ‘theme1796’).wp_specialchars($s).__(‘" | ‘, ‘theme1796’); bloginfo( ‘name’ );
    } elseif ( is_home() || is_front_page()) {
    bloginfo( ‘name’ ); echo ‘ | ‘; bloginfo( ‘description’ );
    } elseif ( is_404() ) {
    echo __(‘Error 404 Not Found | ‘, ‘theme1796’); bloginfo( ‘name’ );
    } elseif ( is_single() ) {
    wp_title(”);
    } else {
    echo wp_title( ‘ | ‘, false, right ); bloginfo( ‘name’ );
    } ?></title>
    <meta name=”description” content=”<?php wp_title(); echo ‘ | ‘; bloginfo( ‘description’ ); ?>” />
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
    <meta name=”viewport” content=”width=device-width,initial-scale=1.0″>
    <link rel=”profile” href=”https://gmpg.org/xfn/11&#8243; />
    <?php if(of_get_option(‘favicon’) != ”){ ?>
    <link rel=”icon” href=”<?php echo of_get_option(‘favicon’, “” ); ?>” type=”image/x-icon” />
    <?php } else { ?>
    <link rel=”icon” href=”<?php bloginfo( ‘template_url’ ); ?>/favicon.ico” type=”image/x-icon” />
    <?php } ?>
    <link rel=”pingback” href=”<?php bloginfo( ‘pingback_url’ ); ?>” />
    <link rel=”alternate” type=”application/rss+xml” title=”<?php bloginfo( ‘name’ ); ?>” href=”<?php bloginfo( ‘rss2_url’ ); ?>” />
    <link rel=”alternate” type=”application/atom+xml” title=”<?php bloginfo( ‘name’ ); ?>” href=”<?php bloginfo( ‘atom_url’ ); ?>” />
    <?php /* The HTML5 Shim is required for older browsers, mainly older versions IE */ ?>
    <!–[if lt IE 8]>
    <div style=’ clear: both; text-align:center; position: relative;’>
    <img src=”https://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg&#8221; border=”0″ alt=”” />
    </div>
    <![endif]–>
    <link rel=”stylesheet” type=”text/css” media=”all” href=”<?php bloginfo( ‘template_url’ ); ?>/css/normalize.css” />
    <link rel=”stylesheet” type=”text/css” media=”all” href=”<?php bloginfo( ‘stylesheet_url’ ); ?>” />
    <link rel=”stylesheet” type=”text/css” media=”all” href=”<?php bloginfo( ‘template_url’ ); ?>/css/prettyPhoto.css” />
    <link rel=”stylesheet” type=”text/css” media=”all” href=”<?php bloginfo( ‘template_url’ ); ?>/css/cameraslideshow.css” />
    <link rel=”stylesheet” type=”text/css” media=”all” href=”<?php bloginfo( ‘template_url’ ); ?>/css/1140.css” />
    <link rel=”stylesheet” type=”text/css” media=”all” href=”<?php bloginfo( ‘template_url’ ); ?>/css/touchTouch.css” />
    <link rel=”stylesheet” type=”text/css” media=”all” href=”<?php bloginfo( ‘template_url’ ); ?>/css/media-queries.css” />
    <!–[if lt IE 10]>
    <link rel=”stylesheet” href=”<?php bloginfo( ‘template_url’ ); ?>/css/ie.css”>
    <![endif]–>
    <?php
    /* We add some JavaScript to pages with the comment form
    * to support sites with threaded comments (when in use).
    */
    if ( is_singular() && get_option( ‘thread_comments’ ) )
    wp_enqueue_script( ‘comment-reply’ );

    /* Always have wp_head() just before the closing </head>
    * tag of your theme, or you will break many plugins, which
    * generally use this hook to add elements to <head> such
    * as styles, scripts, and meta tags.
    */
    wp_head();
    ?>
    <!–[if lt IE 9]>
    <style type=”text/css”>
    #back-top span {
    behavior:url(<?php bloginfo(‘stylesheet_directory’); ?>/PIE.php)
    }
    </style>
    <script src=”<?php bloginfo( ‘template_url’ ); ?>/js/css3-mediaqueries.js” type=”text/javascript”></script>
    <![endif]–>
    <!–[if (gt IE 9)|!(IE)]><!–>
    <script src=”<?php bloginfo( ‘template_url’ ); ?>/js/jquery.mobile.customized.min.js” type=”text/javascript”></script>
    <!–<![endif]–>

    <script type=”text/javascript”>
    // initialise plugins
    jQuery(function(){
    // main navigation init
    jQuery(‘ul.sf-menu’).superfish({
    delay: <?php echo of_get_option(‘sf_delay’); ?>, // one second delay on mouseout
    animation: {opacity:'<?php echo of_get_option(‘sf_f_animation’); ?>'<?php if (of_get_option(‘sf_sl_animation’)==’show’) { ?>,height:'<?php echo of_get_option(‘sf_sl_animation’); ?>'<?php } ?>}, // fade-in and slide-down animation
    speed: ‘<?php echo of_get_option(‘sf_speed’); ?>’, // faster animation speed
    autoArrows: <?php echo of_get_option(‘sf_arrows’); ?>, // generation of arrow mark-up (for submenu)
    dropShadows: false
    });

    // Mobile-menu init
    jQuery(‘.sf-menu’).mobileMenu();

    // prettyphoto init
    jQuery(“a[rel^=’prettyPhoto’]”).prettyPhoto({
    animation_speed:’normal’,
    slideshow:5000,
    autoplay_slideshow: false,
    overlay_gallery: true
    });

    // Initialize the gallery
    jQuery(“#gallery .touch-item”).touchTouch();

    });

    // Init for audiojs
    audiojs.events.ready(function() {
    var as = audiojs.createAll();
    });

    // Init for si.files
    SI.Files.stylizeAll();
    $(function(){
    $(‘.sf-menu > li’).append(‘<span class=”bg-menu”></span>’);
    $(‘.before-content-area .latestpost li:nth-child(4n), .recent-posts.services li:nth-child(4n), .recent-posts.collections li:nth-child(3n)’).addClass(‘nomargin’);
    $(‘.featured-thumbnail a’).append(‘<span class=”stroke”></span>’);
    $(‘.featured-thumbnail a’).hover(
    function(){$(this).find(‘.stroke’).stop().animate({opacity:1.0}, 350)},
    function(){$(this).find(‘.stroke’).stop().animate({opacity:0}, 350)}
    );
    if ($.browser.msie && $.browser.version < 10) {
    jQuery(‘input[type=”submit”], input[type=”reset”]’).hover(function(){
    jQuery(this).addClass(‘submit-hover’)
    },
    function(){
    jQuery(this).removeClass(‘submit-hover’)
    });
    }
    });

    </script>

    <!– Custom CSS –>
    <?php if(of_get_option(‘custom_css’) != ”){?>
    <style type=”text/css”>
    <?php echo of_get_option(‘custom_css’ ) ?>
    </style>
    <?php }?>

    <style type=”text/css”>
    <?php $background = of_get_option(‘body_background’);
    if ($background != ”) {
    if ($background[‘image’] != ”) {
    echo ‘body { background-image:url(‘.$background[‘image’]. ‘); background-repeat:’.$background[‘repeat’].’; background-position:’.$background[‘position’].’; background-attachment:’.$background[‘attachment’].’; }’;
    }
    if($background[‘color’] != ”) {
    echo ‘body { background-color:’.$background[‘color’]. ‘}’;
    }
    };
    ?>

    <?php $header_styling = of_get_option(‘header_color’);
    if($header_styling != ”) {
    echo ‘#header {background-color:’.$header_styling.’}’;
    }
    ?>

    <?php $links_styling = of_get_option(‘links_color’);
    if($links_styling) {
    echo ‘a{color:’.$links_styling.’}’;
    echo ‘.button {background:’.$links_styling.’}’;
    }
    ?>

    </style>
    </head>

    <body <?php body_class(); ?>>

    <div id=”main”><!– this encompasses the entire Web site –>
    <div class=”container”>
    <header id=”header”>
    <div class=”row-logo clearfix”>
    <div class=”logo”>
    <?php if(of_get_option(‘logo_type’) == ‘text_logo’){?>
    <?php if( is_front_page() || is_home() || is_404() ) { ?>
    <h1>/” title=”<?php bloginfo(‘description’); ?>”><img src=”<?php bloginfo(‘template_url’); ?>/images/celogo.png” alt=”<?php bloginfo(‘name’); ?>” title=”<?php bloginfo(‘description’); ?>”></h1>
    <?php } else { ?>
    <h2>/” title=”<?php bloginfo(‘description’); ?>”><img src=”<?php bloginfo(‘template_url’); ?>/images/celogo.png” alt=”<?php bloginfo(‘name’); ?>” title=”<?php bloginfo(‘description’); ?>”></h2>
    <?php } ?>
    <?php } else { ?>
    <?php if(of_get_option(‘logo_url’) != ”){ ?>
    /” id=”logo”><img src=”<?php echo of_get_option(‘logo_url’, “” ); ?>” alt=”<?php bloginfo(‘name’); ?>” title=”<?php bloginfo(‘description’); ?>”>
    <?php } else { ?>
    /” id=”logo”><img src=”<?php bloginfo(‘template_url’); ?>/images/logo.png” alt=”<?php bloginfo(‘name’); ?>” title=”<?php bloginfo(‘description’); ?>”>
    <?php } ?>
    <?php }?>
    <p class=”tagline”><?php bloginfo(‘description’); ?></p></div>
    <div style=”float:left;margin-top:10px;margin-left:130px;”> <img src=”<?php bloginfo(‘template_url’); ?>/images/banner-top.png” alt=”” title=””>

    </div>
    <div style=”float:right;margin-top:15px;”>
    <p style=”margin-left:40px;margin-bottom:5px;font-size:18px;”>TEL: 01908 305123</p> <p style=”margin:2px;padding:0px;”>EMAIL: [email protected]</p>

    <?php // wp_loginout();
    ?>

    <div id=”widget-header”>
    <?php if ( ! dynamic_sidebar( ‘Header’ ) ) : ?><!– Wigitized Header –><?php endif ?>
    </div><!–#widget-header–>
    </div>
    </div>
    <div class=”row-menu”>
    <nav class=”primary”>
    <?php wp_nav_menu( array(
    ‘container’ => ‘ul’,
    ‘menu_class’ => ‘sf-menu’,
    ‘menu_id’ => ‘topnav’,
    ‘depth’ => 0,
    ‘theme_location’ => ‘header_menu’
    ));
    ?>
    </nav><!–.primary–>
    <?php if ( of_get_option(‘g_search_box_id’) == ‘yes’) { ?>
    <div id=”top-search”>
    <form method=”get” action=”<?php echo get_option(‘home’); ?>/”>
    <input type=”submit” value=”<?php _e(‘GO’, ‘theme1796’); ?>” id=”submit”><input type=”text” name=”s” class=”input-search”/>
    </form>
    </div>
    <?php } ?>
    </div>
    </header>
    <?php if( is_front_page() ) { ?>
    <section id=”slider-wrapper”>
    <?php include_once(TEMPLATEPATH . ‘/slider.php’); ?>
    </section><!–#slider–>
    <?php } ?>
    <div class=”primary_content_wrap clearfix”>
    <div class=”row”>

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Help- Coding showing instead of correct content on page’ is closed to new replies.