• Hi there,

    I had a theme designed for me and it seems I can’t get Lightbox (or some other scripts as well) to work without adding the wp_head function into the header.php file.

    When I do this, it buggers up the navigation and the hover over buttons.

    I’m not sure if this is because of the stylesheet (https://kobrashredders.com.au/wp-content/themes/Kobra/style.css) or because of the coding in header.php or what really!

    Any help or insight into this would be much appreciated!!

    Code for header.php is as follows (doesn’t include the wp_head include)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml">
    <head profile="https://gmpg.org/xfn/11">
    
    	<title><?php bloginfo('name'); ?> - <?php wp_title(); ?></title>
    
    	<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    	<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please -->
    	<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    	<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.js"></script>
    	<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/superfish.js"></script>
    	<script type="text/javascript">
    	 	$(document).ready(function(){
            $("ul.sf-menu").superfish({
                delay:     1200
            });
        });
    	</script>
    
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=425,height=344,left = 507.5,top = 278');");
    }
    // End -->
    </script>
    
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function popUp2(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=620,height=700,left = 507.5,top = 278');");
    }
    // End -->
    </script>
    
    </head>
    <body>
    	<div id="wrap">
    	<div id="main" class="clearfix">
    	<div id="header">
    		<h1>
    			<a href="<?php bloginfo('url'); ?>/">Kobra Shredders Australia Pty Ltd</a>
    		</h1>
    
    		<div id="tagline">The Most Advanced Shredding Technology</div>
    
    		<ul id="header_buttons">
    			<li>
    			<a href="?page_id=28" id="quote">Request A Quote</a>
    			</li>
    			<li>
    			<a href="?page_id=28" id="email">Click Here To Email Us</a>
    			</li>
    		</ul>
    	</div>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter dalla

    (@dalla)

    bump

    Well, wp_head() adds code to your header for meta tags, script and css links, etc. It’s probably a good idea to have it there, as any plugins that need to add script files to the header use it to hook to and add the necessary code.

    To help diagnose the problem, try putting it in and then removing it, and look at the source code of the generated page before and after. By comparing the two you’ll be able to see what code is getting added in by wp_head and thus fixing/breaking other stuff. My guess is that you have a lightbox plugin? and that plugin adds the necessary scripts (prototype and scriptaculous) in the wp_head. That would explain why it only works with that function in.

    Hope that helps…

    Hi,

    Something which is overlooked is the default ‘use lightbox’ setting. Make sure it is un-checked in admin.

    Go to Appearance/Lightbox Plus/ and scroll down to:

    Do Not Auto-Lightbox Images:

    Uncheck and Lightbox should be good to go.

    Hope this helps someone.

    Gary

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problem with wp_head function (and lightbox)’ is closed to new replies.