page working then stops rendering completely
-
I modified the default template to include our university template. Everything looked perfect, except for the sidebar. I modified the stylesheet and sidebar.php. When I uploaded it, the sidebar disappeared and the page did not render to completion. I started over and had it working again. I took out some of the Meta links and uploaded sidebar.php, and the same thing happened. Here is the page:
https://www.depts.ttu.edu/agriculturalsciences/jobs/
and here is what I’m trying to accomplish:
https://www.depts.ttu.edu/agriculturalsciences/news/
Can anyone help me with this?
Thanks,
Kris
-
Hi
Your jobs page is not loading the right sidebar. The news page is.
There will be a line of code in whatever template the News page is using that calls in the right sidebar.
You must figure out what template the Jobs page uses, and add that same line of code from the news page template into the jobs page template, in the same place in the file that it is, in the News page template file.
Hi,
I do have the code for the sidebar: <?php get_sidebar(); ?> in the index page, just like the news site. The news site is WP 2.6, but that shouldn’t make a difference. The thing that I don’t understand is that it was working perfectly and all I did was change the sidebar.php file. Then it went haywire. I even copied the news index page and sidebar, etc., but the sidebar didn’t show up. It also doesn’t render the footer, which is included in index.php. Should I just use WP 2.6 since I know it works?
Hi
Please post your sidebar code either on your site or in a pastebin https://wordpress.pastebin.ca and post the URL here.
Obviously something in your code is causing the issue.
You have two sidebars. Are they both defined in sidebar.php or is one defined in a second sidebar file? If a second, what is the name of the file? If they are both defined in one file, how does the code know whether it is being called to load the left or the right sidebar?
Thank you for helping me.
There is only one sidebar that is called. The left sidebar is part of the university template. Instead of breaking the file into header.php, footer.php and index.php, I just put it all in index.php. Here is the code:
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/?>
<!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><title><?php wp_title(‘«’, true, ‘right’); ?> <?php bloginfo(‘name’); ?></title>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /><style type=”text/css” media=”all”>
@import “null?\”\{“;
@import “/template/css/global_relative.css”;
</style>
<style type=”text/css” media=”all”>
@media tty { i{content:”\”;/*” “*/}}@m; @import ‘/template/css/global_relative.css’; /*”;} }/* */
</style>
<script src=”/template/scripts/nav.js” type=”text/javascript”></script>
<script src=”/template/scripts/AC_RunActiveContent.js” type=”text/javascript”></script>
<link type=”text/css” media=”print” rel=”stylesheet” href=”/template/css/print.css” />
<link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/css” media=”screen” />
</head>
<body >
<div id=”skipLinks”>skip to: page content | links on this page | site navigation | footer (site information)</div>
<div id=”container”>
<div id=”masthead”>
<!– BEGINNING OF LOGO AND UPPER NAVIGATION REGION: MASTHEAD –>
<img src=”/template/titles/title_casnr.gif” alt=”Texas Tech University” id=”headerLogo” height=”92″ width=”448″ /> </div>
<div id=”globalNav”>
<? include ($_SERVER[‘DOCUMENT_ROOT’].”/template/ttu_template_components/Global_TopNav.xhtml”); ?>
</div>
<!– END OF LOGO AND UPPER NAVIGATION REGION: MASTHEAD –>
<!– ___________________________________________________________________________________________ –>
<div id=”sideBar”>
<? include ($_SERVER[‘DOCUMENT_ROOT’].”/template/ttu_template_components/Tier3_Search.xhtml”); ?>
<!– AUDIENCE LEFT HAND NAVIGATION BEGINS –><? include (“https://www.depts.ttu.edu/agriculturalsciences/includes/siteMenu_new2.html”); ?>
<h3 onclick=”showHideSwitch(‘ttuMenu’)” class=”expandMenuHdr”>Texas Tech University <img src=”/template/images/icons/menu_on_grey.gif” width=”7″ height=”7″ id=”ttuMenuButton” alt=”Expand TTU Menu.” /></h3>
<dl class=”expandMenu” style=”margin:0;” id=”mainTTUmenu”>
<dd class=”showSwitch” id=”ttuMenu”>
<? include ($_SERVER[‘DOCUMENT_ROOT’].”/template/ttu_template_components/Global_LeftNav.xhtml”); ?>
</dd>
</dl>
<script language=”javascript” type=”text/javascript” src=”/template/scripts/collapse.js”></script>
Need Help?</div>
<!– ____________________________________________________________________________________________________________________ –>
<div id=”crumbs”>
TTU Home
CASNR HomeCASNR Jobs</div>
<!– ____________________________________________________________________________________________________________________ –>
<div id=”content”>
<div class=”narrowcolumn”>
<h1>CASNR Jobs</h1><?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>
<h2>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></h2>
<p class=”date”><?php the_time(‘F jS, Y’) ?> <!– by <?php the_author() ?> –></p><div class=”entry”>
<?php the_content(‘Read the rest of this entry »’); ?>
</div></div>
<?php endwhile; ?>
<div class=”navigation”>
<div class=”alignleft”><?php next_posts_link(‘« Older Entries’) ?></div>
<div class=”alignright”><?php previous_posts_link(‘Newer Entries »’) ?></div>
</div><?php else : ?>
<h2 class=”center”>Not Found</h2>
<p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
<?php get_search_form(); ?><?php endif; ?>
</div>
<?php get_sidebar(); ?>
</div>
<div id=”footer”>
<? include (“https://www.depts.ttu.edu/agriculturalsciences/includes/globalContacts_new2.html”); ?><? include ($_SERVER[‘DOCUMENT_ROOT’].”/template/ttu_template_components/Global_Footer.xhtml”); ?>
<p>©2007
Texas Tech University | All Rights Reserved |
<script language=”JavaScript” type=”text/javascript”><!–//hide script from old browsers
document.write( “Last updated: ” + document.lastModified +””);
//end hiding contents –>
</script>
</p>
</div>
</div>
</body>
</html>Sorry about all that code. Here is the pastbin link:
https://wordpress.pastebin.ca/1351630
How cool is that?!
Hi
Something must be wrong with your sidebar.php file because the get_sidebar() is not loading it. That function only loads a file named sidebar.php. That is the name of your sidebar file?
if not, you can use <?php include (‘sidebar2.php’); ?> or whatever the file is named.
Can you please put your sidebar file in another pastebin?
Here is my sidebar.php file:
https://wordpress.pastebin.ca/1351663
I also don’t understand why the rest of the page (footer) doesn’t load either.
Thanks again.
Hi – The first thing I see is it appears you have an extra closing php tag near the bottom of the file, as marked below:
<ul> <?php wp_register(); ?> <li><?php wp_loginout(); ?></li> <?php wp_meta(); ?> </ul> </li> <!-- THIS IS EXTRA AND NOT NEEDED <?php } ?> --> <?php endif; ?> </ul>
I ran your jobs page through the page validator and it has a few errors around DIV’s improperly closed – that sort of thing can cause this type of problem. See if you can clean up the errors and if that corrects your problem.
https://validator.w3.org/check?uri=https://www.depts.ttu.edu/agriculturalsciences/jobs/Another thing is your left sidebar, in the code you sent earlier, is defined as
<div id="sideBar">
Your right sidebar is defined as<div id="sidebar">
An ID must be unique in a document. Some parts of HTML and CSS are case sensitive and others are not. Its not good practice to have names that similar. If you want to have them both identified as “sidebar” for CSS purposes, its better to make it a class instead of an ID as classes don’t have to be unique.
See if all this helps
Wow, thanks! That extra code in the sidebar was causing the problem. I will also change the name to sidebar2. Have a great day!
- The topic ‘page working then stops rendering completely’ is closed to new replies.